Make it possible to load only specific nodes

This commit is contained in:
Jan Oberhauser
2020-12-01 10:53:43 +01:00
parent f79cb7e989
commit ea79e80c17
2 changed files with 30 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ class LoadNodesAndCredentialsClass {
} = {};
excludeNodes: string[] | undefined = undefined;
includeNodes: string[] | undefined = undefined;
nodeModulesPath = '';
@@ -63,6 +64,7 @@ class LoadNodesAndCredentialsClass {
}
this.excludeNodes = config.get('nodes.exclude');
this.includeNodes = config.get('nodes.include');
// Get all the installed packages which contain n8n nodes
const packages = await this.getN8nNodePackages();
@@ -175,6 +177,10 @@ class LoadNodesAndCredentialsClass {
tempNode.description.icon = 'file:' + path.join(path.dirname(filePath), tempNode.description.icon.substr(5));
}
if (this.includeNodes !== undefined && !this.includeNodes.includes(fullNodeName)) {
return;
}
// Check if the node should be skiped
if (this.excludeNodes !== undefined && this.excludeNodes.includes(fullNodeName)) {
return;