@n8n/create-node 0.3.0 โ 0.4.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/README.md +290 -6
- package/package.json +3 -11
- package/LICENSE_EE.md +0 -27
package/README.md
CHANGED
|
@@ -1,13 +1,297 @@
|
|
|
1
1
|
# @n8n/create-node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A powerful scaffolding tool to quickly create custom n8n community nodes with best practices built-in.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ๐ Quick Start
|
|
6
|
+
|
|
7
|
+
Create a new n8n node in seconds:
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm create @n8n/node
|
|
9
|
-
# or
|
|
10
10
|
pnpm create @n8n/node
|
|
11
|
-
# or
|
|
12
|
-
yarn create @n8n/node
|
|
13
11
|
```
|
|
12
|
+
|
|
13
|
+
Follow the interactive prompts to configure your node, or specify options directly:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm create @n8n/node my-awesome-node --template declarative/custom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## ๐ Command Line Options
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm create @n8n/node [NAME] [OPTIONS]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Options
|
|
26
|
+
|
|
27
|
+
| Flag | Description |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| `-f, --force` | Overwrite destination folder if it already exists |
|
|
30
|
+
| `--skip-install` | Skip automatic dependency installation |
|
|
31
|
+
| `--template <template>` | Specify which template to use |
|
|
32
|
+
|
|
33
|
+
### Available Templates
|
|
34
|
+
|
|
35
|
+
- **`declarative/custom`** - Start with a minimal declarative node structure
|
|
36
|
+
- **`declarative/github-issues`** - GitHub Issues integration example
|
|
37
|
+
- **`programmatic/example`** - Full programmatic node with advanced features
|
|
38
|
+
|
|
39
|
+
## ๐ฏ Interactive Setup
|
|
40
|
+
|
|
41
|
+
The CLI will guide you through setting up your node:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
$ pnpm create @n8n/node
|
|
45
|
+
โ @n8n/create-node
|
|
46
|
+
โ
|
|
47
|
+
โ What is your node called?
|
|
48
|
+
โ my-awesome-api-node
|
|
49
|
+
โ
|
|
50
|
+
โ What kind of node are you building?
|
|
51
|
+
โ HTTP API
|
|
52
|
+
โ
|
|
53
|
+
โ What template do you want to use?
|
|
54
|
+
โ Start from scratch
|
|
55
|
+
โ
|
|
56
|
+
โ What's the base URL of the API?
|
|
57
|
+
โ https://api.example.com/v1
|
|
58
|
+
โ
|
|
59
|
+
โ What type of authentication does your API use?
|
|
60
|
+
โ API Key
|
|
61
|
+
โ
|
|
62
|
+
โ Files copied โ
|
|
63
|
+
โ
|
|
64
|
+
โ Dependencies installed โ
|
|
65
|
+
โ
|
|
66
|
+
โ Next Steps โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
|
|
67
|
+
โ โ
|
|
68
|
+
โ cd ./my-awesome-api-node && pnpm run dev โ
|
|
69
|
+
โ โ
|
|
70
|
+
โ ๐ Documentation: https://docs.n8n.io/integrations/creating-nodes/ โ
|
|
71
|
+
โ ๐ฌ Community: https://community.n8n.io โ
|
|
72
|
+
โ โ
|
|
73
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
74
|
+
โ
|
|
75
|
+
โ Created ./my-awesome-api-node โจ
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## ๐ ๏ธ Development Workflow
|
|
79
|
+
|
|
80
|
+
### 1. Navigate to your project
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
cd ./my-awesome-api-node
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 2. Start development server
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pnpm dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This command:
|
|
93
|
+
- Starts n8n in development mode on `http://localhost:5678`
|
|
94
|
+
- Enables hot reload for your node changes
|
|
95
|
+
- Automatically includes your node in the n8n instance
|
|
96
|
+
- Links your node to `~/.n8n-node-cli/.n8n/custom` for development
|
|
97
|
+
- Watches for file changes and rebuilds automatically
|
|
98
|
+
|
|
99
|
+
### 3. Test your node
|
|
100
|
+
|
|
101
|
+
- Open n8n at `http://localhost:5678`
|
|
102
|
+
- Create a new workflow
|
|
103
|
+
- Find your node in the node panel
|
|
104
|
+
- Test parameters and functionality in real-time
|
|
105
|
+
|
|
106
|
+
## ๐ฆ Generated Project Commands
|
|
107
|
+
|
|
108
|
+
Your generated project comes with these convenient npm scripts:
|
|
109
|
+
|
|
110
|
+
### Development
|
|
111
|
+
```bash
|
|
112
|
+
pnpm dev
|
|
113
|
+
# Runs: n8n-node dev
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Building
|
|
117
|
+
```bash
|
|
118
|
+
pnpm build
|
|
119
|
+
# Runs: n8n-node build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Linting
|
|
123
|
+
```bash
|
|
124
|
+
pnpm lint
|
|
125
|
+
# Runs: n8n-node lint
|
|
126
|
+
|
|
127
|
+
pnpm lint:fix
|
|
128
|
+
# Runs: n8n-node lint --fix
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Publishing
|
|
132
|
+
```bash
|
|
133
|
+
pnpm run release
|
|
134
|
+
# Runs: n8n-node release
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## ๐ฆ Build & Deploy
|
|
138
|
+
|
|
139
|
+
### Build for production
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pnpm build
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Generates:
|
|
146
|
+
- Compiled TypeScript code
|
|
147
|
+
- Bundled node package
|
|
148
|
+
- Optimized assets and icons
|
|
149
|
+
- Ready-to-publish package
|
|
150
|
+
|
|
151
|
+
### Quality checks
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pnpm lint
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Validates:
|
|
158
|
+
- Code style and formatting
|
|
159
|
+
- n8n node conventions
|
|
160
|
+
- Common integration issues
|
|
161
|
+
- Cloud publication readiness
|
|
162
|
+
|
|
163
|
+
Fix issues automatically:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pnpm lint:fix
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Publish your node
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
pnpm run release
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Runs [release-it](https://github.com/release-it/release-it) to handle the complete release process:
|
|
176
|
+
- Ensures working directory is clean
|
|
177
|
+
- Verifies you're on the main git branch
|
|
178
|
+
- Increments your package version
|
|
179
|
+
- Runs build and lint checks
|
|
180
|
+
- Updates changelog
|
|
181
|
+
- Creates git tag with version bump
|
|
182
|
+
- Creates GitHub release with changelog
|
|
183
|
+
- Publishes to npm
|
|
184
|
+
|
|
185
|
+
## ๐ Project Structure
|
|
186
|
+
|
|
187
|
+
Your generated project includes:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
my-awesome-api-node/
|
|
191
|
+
โโโ src/
|
|
192
|
+
โ โโโ nodes/
|
|
193
|
+
โ โ โโโ MyAwesomeApi/
|
|
194
|
+
โ โ โโโ MyAwesomeApi.node.ts # Main node logic
|
|
195
|
+
โ โ โโโ MyAwesomeApi.node.json # Node metadata
|
|
196
|
+
โ โโโ credentials/
|
|
197
|
+
โ โโโ MyAwesomeApiAuth.credentials.ts
|
|
198
|
+
โโโ package.json
|
|
199
|
+
โโโ tsconfig.json
|
|
200
|
+
โโโ README.md
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The CLI expects your project to follow this structure for proper building and development.
|
|
204
|
+
|
|
205
|
+
## โ๏ธ Configuration
|
|
206
|
+
|
|
207
|
+
The CLI reads configuration from your `package.json`:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"name": "n8n-nodes-my-awesome-node",
|
|
212
|
+
"n8n": {
|
|
213
|
+
"n8nNodesApiVersion": 1,
|
|
214
|
+
"nodes": [
|
|
215
|
+
"dist/nodes/MyAwesomeApi/MyAwesomeApi.node.js"
|
|
216
|
+
],
|
|
217
|
+
"credentials": [
|
|
218
|
+
"dist/credentials/MyAwesomeApiAuth.credentials.js"
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## ๐จ Node Types
|
|
225
|
+
|
|
226
|
+
Choose the right template for your use case:
|
|
227
|
+
|
|
228
|
+
| Template | Best For | Features |
|
|
229
|
+
|----------|----------|----------|
|
|
230
|
+
| **Declarative** | REST APIs, simple integrations | JSON-based configuration, automatic UI generation |
|
|
231
|
+
| **Programmatic** | Complex logic, custom operations | Full TypeScript control, advanced error handling |
|
|
232
|
+
|
|
233
|
+
## ๐ Troubleshooting
|
|
234
|
+
|
|
235
|
+
### Common Issues
|
|
236
|
+
|
|
237
|
+
**Node not appearing in n8n:**
|
|
238
|
+
```bash
|
|
239
|
+
# Clear n8n node cli cache and restart
|
|
240
|
+
rm -rf ~/.n8n-node-cli/.n8n/custom
|
|
241
|
+
pnpm dev
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**TypeScript errors:**
|
|
245
|
+
```bash
|
|
246
|
+
# Reinstall dependencies
|
|
247
|
+
rm -rf node_modules pnpm-lock.yaml
|
|
248
|
+
pnpm install
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Build failures:**
|
|
252
|
+
```bash
|
|
253
|
+
# Check for linting issues first
|
|
254
|
+
pnpm lint --fix
|
|
255
|
+
pnpm build
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Development server issues:**
|
|
259
|
+
```bash
|
|
260
|
+
# Clear cache and restart development server
|
|
261
|
+
rm -rf ~/.n8n-node-cli/.n8n/custom
|
|
262
|
+
pnpm dev
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## ๐ง Advanced Usage
|
|
266
|
+
|
|
267
|
+
### Using External n8n Instance
|
|
268
|
+
|
|
269
|
+
If you prefer to use your own n8n installation:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
pnpm dev --external-n8n
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Custom User Folder
|
|
276
|
+
|
|
277
|
+
Specify a custom location for n8n user data:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
pnpm dev --custom-user-folder /path/to/custom/folder
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## ๐ Resources
|
|
284
|
+
|
|
285
|
+
- **[Node Development Guide](https://docs.n8n.io/integrations/creating-nodes/)** - Complete documentation
|
|
286
|
+
- **[API Reference](https://docs.n8n.io/integrations/creating-nodes/build/reference/)** - Technical specifications
|
|
287
|
+
- **[Community Forum](https://community.n8n.io)** - Get help and share your nodes
|
|
288
|
+
- **[Node Examples](https://github.com/n8n-io/n8n/tree/master/packages/nodes-base/nodes)** - Official node implementations
|
|
289
|
+
- **[@n8n/node-cli](https://www.npmjs.com/package/@n8n/node-cli)** - The underlying CLI tool
|
|
290
|
+
|
|
291
|
+
## ๐ค Contributing
|
|
292
|
+
|
|
293
|
+
Found a bug or want to contribute? Check out the [n8n repository](https://github.com/n8n-io/n8n) and join our community!
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
**Happy node building! ๐**
|
package/package.json
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/create-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official CLI to create new community nodes for n8n",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-n8n-node": "bin/create.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin",
|
|
10
|
-
"dist"
|
|
11
|
-
"LICENSE.md",
|
|
12
|
-
"LICENSE_EE.md"
|
|
10
|
+
"dist"
|
|
13
11
|
],
|
|
14
12
|
"repository": {
|
|
15
13
|
"type": "git",
|
|
16
14
|
"url": "git+https://github.com/n8n-io/n8n.git"
|
|
17
15
|
},
|
|
18
16
|
"dependencies": {
|
|
19
|
-
"@n8n/node-cli": "0.
|
|
20
|
-
},
|
|
21
|
-
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
|
-
"homepage": "https://n8n.io",
|
|
23
|
-
"author": {
|
|
24
|
-
"name": "Jan Oberhauser",
|
|
25
|
-
"email": "jan@n8n.io"
|
|
17
|
+
"@n8n/node-cli": "0.4.0"
|
|
26
18
|
},
|
|
27
19
|
"scripts": {
|
|
28
20
|
"start": "node bin/create.js"
|
package/LICENSE_EE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# The n8n Enterprise License (the โEnterprise Licenseโ)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022-present n8n GmbH.
|
|
4
|
-
|
|
5
|
-
With regard to the n8n Software:
|
|
6
|
-
|
|
7
|
-
This software and associated documentation files (the "Software") may only be used in production, if
|
|
8
|
-
you (and any entity that you represent) hold a valid n8n Enterprise license corresponding to your
|
|
9
|
-
usage. Subject to the foregoing sentence, you are free to modify this Software and publish patches
|
|
10
|
-
to the Software. You agree that n8n and/or its licensors (as applicable) retain all right, title and
|
|
11
|
-
interest in and to all such modifications and/or patches, and all such modifications and/or patches
|
|
12
|
-
may only be used, copied, modified, displayed, distributed, or otherwise exploited with a valid n8n
|
|
13
|
-
Enterprise license for the corresponding usage. Notwithstanding the foregoing, you may copy and
|
|
14
|
-
modify the Software for development and testing purposes, without requiring a subscription. You
|
|
15
|
-
agree that n8n and/or its licensors (as applicable) retain all right, title and interest in and to
|
|
16
|
-
all such modifications. You are not granted any other rights beyond what is expressly stated herein.
|
|
17
|
-
Subject to the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense, and/or
|
|
18
|
-
sell the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
21
|
-
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
23
|
-
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
24
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
|
-
|
|
26
|
-
For all third party components incorporated into the n8n Software, those components are licensed
|
|
27
|
-
under the original license provided by the owner of the applicable component.
|