n8n-nodes-fasttext-language-detector 0.1.0 → 0.1.1

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.
@@ -35,7 +35,6 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.FastTextLanguageDetector = void 0;
37
37
  const n8n_workflow_1 = require("n8n-workflow");
38
- const fastText = __importStar(require("fasttext.js"));
39
38
  const fs = __importStar(require("fs"));
40
39
  class FastTextLanguageDetector {
41
40
  constructor() {
@@ -194,7 +193,9 @@ class FastTextLanguageDetector {
194
193
  if (!fs.existsSync(modelPath)) {
195
194
  throw new n8n_workflow_1.ApplicationError(`Model file not found: ${modelPath}`, { level: 'error' });
196
195
  }
197
- // Загружаем модель
196
+ // Динамически загружаем fasttext.js только когда он нужен
197
+ // Это предотвращает загрузку WASM при старте n8n
198
+ const fastText = await Promise.resolve().then(() => __importStar(require('fasttext.js')));
198
199
  model = new fastText.Classifier(modelPath);
199
200
  FastTextLanguageDetector.modelCache.set(modelPath, model);
200
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-fasttext-language-detector",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "n8n node for language detection using fastText",
5
5
  "author": {
6
6
  "name": "Your Name",
@@ -8,49 +8,50 @@
8
8
  },
9
9
  "license": "MIT",
10
10
  "keywords": [
11
- "n8n-community-node-package",
12
- "fasttext",
13
- "language-detection",
14
- "nlp"
11
+ "n8n-community-node-package",
12
+ "fasttext",
13
+ "language-detection",
14
+ "nlp"
15
15
  ],
16
16
  "main": "index.js",
17
17
  "scripts": {
18
- "build": "rm -rf dist && tsc && gulp build:icons",
19
- "dev": "npm run build && npx n8n",
20
- "dev:watch": "tsc --watch",
21
- "format": "prettier nodes credentials --write",
22
- "lint": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" \"package.json\"",
23
- "lintfix": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" \"package.json\" --fix",
24
- "prepublishOnly": "npm run build && npm run lint -s"
18
+ "build": "rm -rf dist && tsc && gulp build:icons",
19
+ "dev": "npm run build && npx n8n",
20
+ "dev:watch": "tsc --watch",
21
+ "format": "prettier nodes credentials --write",
22
+ "lint": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" \"package.json\"",
23
+ "lintfix": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" \"package.json\" --fix",
24
+ "prepublishOnly": "npm run build && npm run lint -s"
25
25
  },
26
26
  "files": [
27
- "dist"
27
+ "dist",
28
+ "index.js"
28
29
  ],
29
30
  "n8n": {
30
- "n8nNodesApiVersion": 1,
31
- "credentials": [
32
- "dist/credentials/FastTextModel.credentials.js"
33
- ],
34
- "nodes": [
35
- "dist/nodes/FastTextLanguageDetector/FastTextLanguageDetector.node.js"
36
- ]
31
+ "n8nNodesApiVersion": 1,
32
+ "credentials": [
33
+ "dist/credentials/FastTextModel.credentials.js"
34
+ ],
35
+ "nodes": [
36
+ "dist/nodes/FastTextLanguageDetector/FastTextLanguageDetector.node.js"
37
+ ]
37
38
  },
38
39
  "devDependencies": {
39
- "@types/node": "^20.10.0",
40
- "@typescript-eslint/parser": "^6.13.0",
41
- "@typescript-eslint/eslint-plugin": "^6.13.0",
42
- "eslint": "^8.57.1",
43
- "eslint-plugin-n8n-nodes-base": "^1.11.0",
44
- "gulp": "^4.0.2",
45
- "n8n": "*",
46
- "n8n-workflow": "*",
47
- "prettier": "^3.1.0",
48
- "typescript": "^5.3.0"
40
+ "@types/node": "^20.10.0",
41
+ "@typescript-eslint/parser": "^6.13.0",
42
+ "@typescript-eslint/eslint-plugin": "^6.13.0",
43
+ "eslint": "^8.57.1",
44
+ "eslint-plugin-n8n-nodes-base": "^1.11.0",
45
+ "gulp": "^4.0.2",
46
+ "n8n": "*",
47
+ "n8n-workflow": "*",
48
+ "prettier": "^3.1.0",
49
+ "typescript": "^5.3.0"
49
50
  },
50
51
  "dependencies": {
51
- "fasttext.js": "^1.1.4"
52
+ "fasttext.js": "^1.1.4"
52
53
  },
53
54
  "peerDependencies": {
54
- "n8n-workflow": "*"
55
+ "n8n-workflow": "*"
55
56
  }
56
- }
57
+ }