n8n-nodes-hatr-hello-world 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hai Tran
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# n8n-nodes-hatr-hello-world
|
|
2
|
+
|
|
3
|
+
This is an n8n community node that provides a simple "Hello World" functionality. It accepts input data and returns it as output with an added custom message.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Pass Through Operation**: Accepts input data and returns it unchanged
|
|
8
|
+
- **Custom Message**: Adds a custom message field to the output
|
|
9
|
+
- **Timestamp**: Automatically adds a timestamp to each output item
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### Community Nodes (Recommended)
|
|
14
|
+
|
|
15
|
+
For n8n cloud or self-hosted instances with community nodes enabled:
|
|
16
|
+
|
|
17
|
+
1. Go to **Settings** > **Community Nodes**
|
|
18
|
+
2. Select **Install**
|
|
19
|
+
3. Enter `n8n-nodes-hatr-hello-world` in the **Enter npm package name** field
|
|
20
|
+
4. Click **Install**
|
|
21
|
+
|
|
22
|
+
### Manual Installation
|
|
23
|
+
|
|
24
|
+
To install manually in your n8n installation:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd ~/.n8n/nodes
|
|
28
|
+
npm install n8n-nodes-hatr-hello-world
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then restart n8n.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
1. Add the "Hatr Hello World" node to your workflow
|
|
36
|
+
2. Configure the custom message (default: "Hello World!")
|
|
37
|
+
3. Connect input data from a previous node
|
|
38
|
+
4. The node will pass through all input data and add:
|
|
39
|
+
- `hatrMessage`: Your custom message
|
|
40
|
+
- `timestamp`: Current timestamp
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
**Input:**
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"name": "John",
|
|
48
|
+
"age": 30
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Output:**
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"name": "John",
|
|
56
|
+
"age": 30,
|
|
57
|
+
"hatrMessage": "Hello World!",
|
|
58
|
+
"timestamp": "2026-02-02T00:55:12.000Z"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
### Setup
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm install
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Build
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm run build
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Watch Mode
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm run dev
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Lint
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run lint
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
|
91
|
+
|
|
92
|
+
## Resources
|
|
93
|
+
|
|
94
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
95
|
+
- [n8n node development guide](https://docs.n8n.io/integrations/creating-nodes/)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class HatrHelloWorld implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HatrHelloWorld = void 0;
|
|
4
|
+
class HatrHelloWorld {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Hatr Hello World',
|
|
8
|
+
name: 'hatrHelloWorld',
|
|
9
|
+
icon: 'file:hatrHelloWorld.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
13
|
+
description: 'A simple node that accepts input and returns output',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'Hatr Hello World',
|
|
16
|
+
},
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
name: 'Pass Through',
|
|
28
|
+
value: 'passThrough',
|
|
29
|
+
description: 'Pass input data directly to output',
|
|
30
|
+
action: 'Pass input data directly to output',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
default: 'passThrough',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Message',
|
|
37
|
+
name: 'message',
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: 'Hello World!',
|
|
40
|
+
description: 'A custom message to add to the output',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async execute() {
|
|
46
|
+
const items = this.getInputData();
|
|
47
|
+
const returnData = [];
|
|
48
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
49
|
+
const message = this.getNodeParameter('message', 0);
|
|
50
|
+
// Process each item
|
|
51
|
+
for (let i = 0; i < items.length; i++) {
|
|
52
|
+
const item = items[i];
|
|
53
|
+
if (operation === 'passThrough') {
|
|
54
|
+
// Pass through the input data and add the custom message
|
|
55
|
+
returnData.push({
|
|
56
|
+
json: {
|
|
57
|
+
...item.json,
|
|
58
|
+
hatrMessage: message,
|
|
59
|
+
timestamp: new Date().toISOString(),
|
|
60
|
+
},
|
|
61
|
+
binary: item.binary,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return [returnData];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.HatrHelloWorld = HatrHelloWorld;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="60px" height="60px" viewBox="0 0 60 60" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
4
|
+
<circle fill="#FF6D5A" cx="30" cy="30" r="30"/>
|
|
5
|
+
<text font-family="Arial, sans-serif" font-size="24" font-weight="bold" fill="#FFFFFF">
|
|
6
|
+
<tspan x="50%" y="50%" text-anchor="middle" dominant-baseline="central">HW</tspan>
|
|
7
|
+
</text>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-hatr-hello-world",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A simple n8n community node that accepts input and returns output",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"hello-world"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://github.com/epihatr/n8n-nodes-hatr-hello-world",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Hai Tran",
|
|
14
|
+
"email": "hidetran@gmail.com"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/epihatr/n8n-nodes-hatr-hello-world.git"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "index.js",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc && gulp buildIcons",
|
|
24
|
+
"dev": "tsc --watch",
|
|
25
|
+
"format": "prettier nodes --write",
|
|
26
|
+
"lint": "eslint nodes package.json",
|
|
27
|
+
"lintfix": "eslint nodes package.json --fix",
|
|
28
|
+
"prepublishOnly": "npm run build && npm run lint -c .eslintrc.prepublish.js nodes package.json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"n8n": {
|
|
34
|
+
"n8nNodesApiVersion": 1,
|
|
35
|
+
"nodes": [
|
|
36
|
+
"dist/nodes/HatrHelloWorld/HatrHelloWorld.node.js"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.39.2",
|
|
41
|
+
"@types/node": "^22.10.5",
|
|
42
|
+
"eslint": "^9.39.2",
|
|
43
|
+
"eslint-plugin-n8n-nodes-base": "^1.16.6",
|
|
44
|
+
"gulp": "^5.0.1",
|
|
45
|
+
"n8n-workflow": "^2.6.0",
|
|
46
|
+
"prettier": "^3.8.1",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"typescript-eslint": "^8.20.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"n8n-workflow": "*"
|
|
52
|
+
}
|
|
53
|
+
}
|