Skip to content

Commit ac73888

Browse files
committed
Initial commit
1 parent 1a2c449 commit ac73888

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "node-red-contrib-rsync",
3+
"version": "1.0.0",
4+
"description": "Node Red wrapper for rsync",
5+
"main": "rsync-wrapper.js",
6+
"scripts": {
7+
"test": "echo \"No test specified\""
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/michaelblight/node-red-contrib-rsync.git"
12+
},
13+
"keywords": [
14+
"node",
15+
"red",
16+
"rsync"
17+
],
18+
"author": "Michael Blight",
19+
"license": "Apache-2.0",
20+
"bugs": {
21+
"url": "https://github.com/michaelblight/node-red-contrib-rsync/issues"
22+
},
23+
"homepage": "https://github.com/michaelblight/node-red-contrib-rsync#readme"
24+
}

rsync-wrapper.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script type="text/javascript">
2+
RED.nodes.registerType('rsync', {
3+
category: 'function',
4+
color: '#a6bbcf',
5+
defaults: {
6+
name: {value: ""}
7+
},
8+
inputs: 1,
9+
outputs: 1,
10+
icon: "file.png",
11+
label: function() {
12+
return this.name || "rsync";
13+
}
14+
});
15+
</script>
16+
17+
<script type="text/x-red" data-template-name="rsync">
18+
<div class="form-row">
19+
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
20+
<input type="text" id="node-input-name" placeholder="Name">
21+
</div>
22+
</script>
23+
24+
<script type="text/x-red" data-help-name="rsync">
25+
<p>A node that uses rsyncwrapper to call rsync.</p>
26+
</script>

rsync-wrapper.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = function(RED) {
2+
function rsyncNode(config) {
3+
RED.nodes.createNode(this, config);
4+
var node = this;
5+
node.on('input', function(msg) {
6+
msg.payload = msg.payload.toLowerCase();
7+
node.send(msg);
8+
});
9+
}
10+
RED.nodes.registerType("rsync", rsyncNode);
11+
}

0 commit comments

Comments
 (0)