Node file structure
Following best practices and standards in your node structure makes your node easier to maintain. It's helpful if other people need to work with the code.
Node file structure
Following best practices and standards in your node structure makes your node easier to maintain. It's helpful if other people need to work with the code.
The file and directory structure of your node depends on:
- Your node's complexity.
- Whether you use node versioning.
- How many nodes you include in the npm package.
n8n recommends using the n8n-node tool to create the expected node file structure. You can customize the generated scaffolding as required to meet more complex needs.
Required files and directories
Your node must include:
- A
package.jsonfile at the root of the project. Every npm module requires this. - A
nodesdirectory, containing the code for your node:
