- Run
pnpm install
to install dependencies - Execute with
node index.mjs
- Output:
[ 'n8n-nodes-base' ]
- Output:
- Change to
deep: 2
on line 8 ofindex.mjs
- Execute again with
node index.mjs
- Output:
[ 'n8n-nodes-base', '@telepilotco/n8n-nodes-kv-storage' ]
- Output:
Last active
July 31, 2023 14:46
-
-
Save MariusRumpf/3a231c011714ac2e82cc871482593112 to your computer and use it in GitHub Desktop.
n8n community module loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob from 'fast-glob'; | |
const main = async () => { | |
const nodeModulesDir = 'node_modules'; | |
const installedPackagePaths = await glob(['n8n-nodes-*', '@*/n8n-nodes-*'], { | |
cwd: nodeModulesDir, | |
onlyDirectories: true, | |
deep: 1, // try with deep: 2 to fix | |
}); | |
console.log(installedPackagePaths); | |
}; | |
await main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "glob-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.mjs", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"@telepilotco/n8n-nodes-kv-storage": "^0.0.1", | |
"fast-glob": "^3.2.5", | |
"n8n-nodes-base": "^0.220.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment