@ferchy/n8n-nodes-aimc-toolkit 0.1.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AIMC Toolkit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,249 @@
1
+ # AIMC Toolkit for n8n
2
+
3
+ AIMC Toolkit is a community node package for n8n with two focused nodes:
4
+
5
+ - **AIMC Code**: run JavaScript with a practical toolbox of libraries.
6
+ - **AIMC Media**: FFmpeg-powered media operations without extra glue nodes.
7
+
8
+ ## Why I Built This
9
+
10
+ n8n is powerful, but real workflows often need basic utilities (validation, parsing, HTTP) and media tasks (convert, compress, merge). I built AIMC Toolkit to remove the busywork and keep workflows short, readable, and fast.
11
+
12
+ ## Who This Is For
13
+
14
+ - Automation builders who want fewer nodes and faster iterations.
15
+ - Agencies handling content workflows, clips, and format conversions.
16
+ - Founders and teams building internal tooling on n8n.
17
+ - Power users who want a better code node and real media ops.
18
+
19
+ ## Why AIMC Toolkit
20
+
21
+ - **Fewer nodes, cleaner flows**: consolidate multiple steps into one code node.
22
+ - **Media ready**: convert, compress, merge, and inspect media in one place.
23
+ - **Practical libraries**: parsing, validation, dates, and web utilities built in.
24
+
25
+ ## Installation
26
+
27
+ ### Prerequisites
28
+ - n8n is already installed and running (self-hosted or desktop).
29
+ - Community nodes are enabled in your n8n instance.
30
+ - n8n Cloud does not support community nodes.
31
+
32
+ ### Community Nodes (Recommended)
33
+ 1. Open **Settings > Community Nodes** in n8n.
34
+ 2. Install: `@ferchy/n8n-nodes-aimc-toolkit`.
35
+
36
+ ### Manual
37
+ ```bash
38
+ npm install @ferchy/n8n-nodes-aimc-toolkit
39
+ ```
40
+
41
+ ## FFmpeg Setup
42
+
43
+ AIMC Media will use the first available option:
44
+
45
+ 1. `FFMPEG_PATH` / `FFPROBE_PATH` environment variables
46
+ 2. Bundled `ffmpeg-static` / `ffprobe-static`
47
+ 3. System FFmpeg on `PATH`
48
+
49
+ If `ffmpeg-static` cannot install in your environment, install system FFmpeg.
50
+
51
+ ### Docker (n8n official image)
52
+ ```bash
53
+ docker exec <container> apk add --no-cache ffmpeg
54
+ ```
55
+
56
+ ### Debian/Ubuntu
57
+ ```bash
58
+ apt-get update && apt-get install -y ffmpeg
59
+ ```
60
+
61
+ ### macOS (Homebrew)
62
+ ```bash
63
+ brew install ffmpeg
64
+ ```
65
+
66
+ ## Nodes
67
+
68
+ ### AIMC Code
69
+
70
+ **Features**
71
+ - Run JavaScript or Python.
72
+ - Run once for all items or once per item.
73
+ - Access libraries as globals (`axios`, `_`, `zod`) or via `libs`.
74
+ - Built-in helpers (`utils.now`, `utils.safeJson`, `utils.toArray`).
75
+
76
+ **Example: normalize data**
77
+ ```javascript
78
+ const rows = $input.all().map((i) => i.json);
79
+ const ids = rows.map(() => nanoid());
80
+
81
+ return rows.map((row, index) => ({
82
+ ...row,
83
+ id: ids[index],
84
+ normalizedEmail: validator.normalizeEmail(row.email || ''),
85
+ createdAt: utils.now(),
86
+ }));
87
+ ```
88
+
89
+ **Example: fetch + parse XML**
90
+ ```javascript
91
+ const response = await axios.get('https://example.com/feed.xml');
92
+ const parsed = await xml2js.parseStringPromise(response.data);
93
+
94
+ return parsed;
95
+ ```
96
+
97
+ **Python Example: summarize inputs**
98
+ ```python
99
+ # items is a list of dicts, item is the first item
100
+ result = {
101
+ "count": len(items),
102
+ "first": items[0] if items else None
103
+ }
104
+ ```
105
+
106
+ ### AIMC Media
107
+
108
+ **Operations**
109
+ - Convert / Transcode
110
+ - Compress
111
+ - Extract Audio
112
+ - Merge Video + Audio
113
+ - Metadata (ffprobe)
114
+
115
+ **Key Options**
116
+ - **Input Mode**: Binary or File Path
117
+ - **Output Mode**: Binary or File Path
118
+ - **Output Format**: mp4, webm, mov, mp3, wav, and more
119
+ - **Extra FFmpeg Args**: one per line for advanced control
120
+
121
+ **Example: convert and scale**
122
+ ```
123
+ Operation: Convert / Transcode
124
+ Output Format: WebM
125
+ Additional Output Options:
126
+ -vf scale=1280:-2
127
+ ```
128
+
129
+ **Example: compress**
130
+ ```
131
+ Operation: Compress
132
+ CRF: 24
133
+ Preset: fast
134
+ Audio Bitrate: 128k
135
+ ```
136
+
137
+ **Example: merge video + audio**
138
+ ```
139
+ Operation: Merge Video + Audio
140
+ Input Mode: File Path
141
+ Video File Path: /path/to/video.mp4
142
+ Audio File Path: /path/to/audio.mp3
143
+ ```
144
+
145
+ **Large Files**
146
+ Use **Input Mode = File Path** to avoid loading big files into memory.
147
+
148
+ ## Library Reference (AIMC Code)
149
+
150
+ Libraries are available as globals or via `libs.<name>`.
151
+
152
+ ## Python Support (AIMC Code)
153
+
154
+ Python executes locally using the configured Python binary (default: `python3`).
155
+ Provide Python code and set a variable named `result` to return output.
156
+
157
+ ### Python Settings
158
+ - **Python Path**: path to the Python binary (e.g. `python3` or `/usr/bin/python3`)
159
+ - **Python Packages**: comma-separated list of packages
160
+ - **Auto-install Python Packages**: runs `pip install --user` before execution
161
+
162
+ ### Python Tips
163
+ - Use `items` (list of dicts) or `item` (first item) as inputs.
164
+ - Use `params` to access node parameters.
165
+ - Keep results JSON-serializable for best compatibility.
166
+
167
+ ### HTTP and Networking
168
+ - `axios` (global `axios`): HTTP client with base URL, headers, query params, timeouts, and interceptors. Use for REST APIs, uploads, downloads, and pagination.
169
+ - `qs` (global `qs`): querystring parsing/stringifying with deep objects. Use for complex filters and API query params.
170
+ - `form-data` (global `FormData`): multipart form uploads. Use for file uploads and mixed form fields.
171
+ - `http-proxy-agent` (global `httpProxyAgent`): route HTTP(S) requests through proxies. Use when your environment requires a proxy.
172
+ - `socks-proxy-agent` (global `socksProxyAgent`): SOCKS proxy support for networking. Use for private network routing.
173
+
174
+ ### Data Parsing and Formats
175
+ - `yaml` (global `YAML`): parse/stringify YAML. Use for config or workflow data stored as YAML.
176
+ - `toml` (global `toml`): parse TOML. Use for reading TOML configs.
177
+ - `xml2js` (global `xml2js`): XML to JS objects. Use for RSS feeds and XML APIs.
178
+ - `fast-xml-parser` (global `XMLParser`): faster XML parsing with schema options. Use when performance matters.
179
+ - `papaparse` (global `papaparse` or `Papa`): CSV parsing and serialization. Use for spreadsheets exported as CSV.
180
+ - `protobufjs` (global `protobufjs` or `protobuf`): encode/decode Protobuf messages. Use for services that expose `.proto` schemas.
181
+
182
+ ### Validation and Schema
183
+ - `zod` (global `zod` or `z`): schema parsing and validation with strong typing. Use for payload validation and clean error messages.
184
+ - `joi` (global `joi` or `Joi`): expressive validation schemas. Use for complex conditional validation.
185
+ - `yup` (global `yup`): object schema validation. Use for forms and input checks.
186
+ - `ajv` (global `Ajv`): JSON Schema validator. Use for OpenAPI/JSON Schema validation.
187
+ - `validator` (global `validator`): common validators and sanitizers (email, URL, IP, etc.). Use for quick checks.
188
+
189
+ ### Dates, Time, and Scheduling
190
+ - `dayjs` (global `dayjs`): lightweight date library. Use for formatting and date math.
191
+ - `date-fns` (global `dateFns`): functional date utilities. Use for immutable date transformations.
192
+ - `date-fns-tz` (global `dateFnsTz`): timezone helpers for `date-fns`. Use for timezone conversions.
193
+ - `moment-timezone` (global `moment`): timezone-aware date formatting and parsing.
194
+ - `cron-parser` (global `cronParser`): parse cron expressions. Use for scheduling checks and next-run calculations.
195
+ - `ms` (global `ms`): parse/format durations. Use for `1h`, `30m`, `2d` handling.
196
+
197
+ ### Text, Search, and Similarity
198
+ - `fuse.js` (global `fuzzy`): fuzzy search over arrays. Use for matching names, titles, or tags.
199
+ - `string-similarity` (global `stringSimilarity`): compare strings by similarity score. Use for deduping or fuzzy matches.
200
+ - `marked` (global `marked`): Markdown to HTML parser. Use for rendering user docs.
201
+ - `slug` (global `slug`): slugify strings. Use for URLs and file names.
202
+ - `pluralize` (global `pluralize`): pluralization and singularization helpers.
203
+ - `html-to-text` (global `htmlToText`): convert HTML to readable plain text.
204
+
205
+ ### Web Scraping and Content
206
+ - `cheerio` (global `cheerio`): jQuery-like HTML parser. Use for DOM extraction and scraping.
207
+
208
+ ### IDs and Utilities
209
+ - `uuid` (global `uuid`): UUID generation. Use for stable IDs.
210
+ - `nanoid` (global `nanoid`): compact unique IDs. Use for short IDs.
211
+ - `bytes` (global `bytes`): parse/format byte sizes. Use for human-readable file sizes.
212
+
213
+ ### Language Tools
214
+ - `franc-min` (global `franc`): language detection for text.
215
+ - `compromise` (global `compromise`): NLP utilities (tags, sentences, entities). Use for quick text analysis.
216
+
217
+ ### Media Helpers
218
+ - `qrcode` (global `QRCode` or `qrcode`): generate QR codes as data URLs or images.
219
+ - `@distube/ytdl-core` (global `ytdl`): download media from supported sources. Use for media ingestion flows.
220
+
221
+ ### Database and Query Helpers
222
+ - `knex` (global `knex`): SQL query builder. Use for lightweight DB queries when allowed by your environment.
223
+
224
+ ### Extra Tools
225
+ - `json-diff-ts` (global `jsonDiff`): JSON diff and comparison utilities. Use for change detection.
226
+ - `iban` (global `iban`): validate and format IBAN numbers.
227
+ - `ini` (global `ini`): parse/stringify INI files.
228
+ - `libphonenumber-js` (global `phoneNumber`): phone number parsing/formatting/validation.
229
+
230
+ ### Optional Native Helpers
231
+ - `bufferutil` (global `bufferutil`): optional native Buffer helpers if installed.
232
+ - `utf-8-validate` (global `utf8Validate`): optional UTF-8 validation if installed.
233
+
234
+ ## Configuration
235
+
236
+ Environment variables:
237
+
238
+ - `FFMPEG_PATH`: custom FFmpeg binary path
239
+ - `FFPROBE_PATH`: custom ffprobe binary path
240
+
241
+ ## Troubleshooting
242
+
243
+ - **FFmpeg not found**: install FFmpeg or set `FFMPEG_PATH`.
244
+ - **Large files**: use File Path input mode.
245
+ - **Binary output missing**: check `Output Mode` and `Output Binary Property`.
246
+
247
+ ## License
248
+
249
+ MIT
@@ -0,0 +1,5 @@
1
+ import { INodeExecutionData, INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow';
2
+ export declare class AimcCode implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }