Skip to content

Commit 863967d

Browse files
committed
match latest wiki changes
1 parent af802f5 commit 863967d

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

docs/creating-nodes/first-node.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ A `package.json` file is used to package it all together as an npm module.
1919
- [lower-case.html](#lower-casehtml)
2020
- [Testing your node in Node-RED](#testing-your-node-in-node-red)
2121

22-
2322
### Creating a simple node
2423

2524
This example will show how to create a node that converts message payloads to
2625
all lower-case characters.
2726

2827
Ensure you have the recommended LTS version of Node.js installed on your system. As of this writing this is version **LTS 8.x** which includes npm version 5.x.
2928

30-
Create a directory where you will develop your code. Within that directory,
31-
create the following files:
29+
Create a directory where you will develop your code. Within that directory, create the following files:
3230

3331
- `package.json`
3432
- `lower-case.js`
@@ -67,7 +65,7 @@ to the [packaging guide](packaging).
6765

6866
<h4 id="lower-casejs"><i class="fa fa-file-o"></i> lower-case.js</h4>
6967

70-
{% highlight javascript %}
68+
```javascript
7169
module.exports = function(RED) {
7270
function LowerCaseNode(config) {
7371
RED.nodes.createNode(this,config);
@@ -79,9 +77,9 @@ module.exports = function(RED) {
7977
}
8078
RED.nodes.registerType("lower-case",LowerCaseNode);
8179
}
82-
{% endhighlight %}
80+
```
8381

84-
The node is wrapped as a node module. The module exports a function that gets called
82+
The node is wrapped as a Node.js module. The module exports a function that gets called
8583
when the runtime loads the node on start-up. The function is called with a single
8684
argument, `RED`, that provides the module access to the Node-RED runtime api.
8785

@@ -108,7 +106,7 @@ For more information about the runtime part of the node, see [here](node-js).
108106
<h4 id="lower-casehtml"><i class="fa fa-file-o"></i> lower-case.html</h4>
109107

110108

111-
{% highlight html %}
109+
```html
112110
<script type="text/javascript">
113111
RED.nodes.registerType('lower-case',{
114112
category: 'function',
@@ -135,7 +133,7 @@ For more information about the runtime part of the node, see [here](node-js).
135133
<script type="text/x-red" data-help-name="lower-case">
136134
<p>A simple node that converts the message payloads into all lower-case characters</p>
137135
</script>
138-
{% endhighlight %}
136+
```
139137

140138
A node's HTML file provides the following things:
141139

@@ -167,7 +165,7 @@ For example, if your node is located at `~/dev/node-red-contrib-example-lower-ca
167165

168166
This creates a symbolic link to your node module project directory in `~/.node-red/node_modules` so that Node-RED will discover the node when it starts. Any changes to the node's file can be picked up by simply restarting Node-RED.
169167

170-
If you are using an older version of npm, you can create a symbolic link manually to your project. To do so:
168+
If you are using an older version of npm, you can create a symbolic link manually to your project. For example on Mac or linux systems:
171169

172170
cd ~/.node-red/node_modules
173171
ln -s ~/dev/node-red-contrib-example-lower-case .

0 commit comments

Comments
 (0)