n8n-nodes-powercode
v1.1.2
Published
n8n node to execute custom JavaScript code with 58+ built-in libraries
Readme
n8n-nodes-powercode
Execute custom JavaScript code with 58+ built-in libraries in n8n workflows.
Power Code is the ultimate code execution node for n8n. Unlike the built-in Code node that ships with zero libraries, Power Code comes pre-loaded with 58+ production-ready JavaScript libraries — from data processing and validation to blockchain and media processing.
n8n is a fair-code licensed workflow automation platform.
Installation
n8n Community Edition
- Open your n8n instance
- Go to Settings → Community Nodes
- Click Install a community node
- Enter:
n8n-nodes-powercode - Click Install
- Find "Power Code" in your node list
Docker Users
environment:
- N8N_COMMUNITY_PACKAGES_ENABLED=trueThen install through the UI as shown above.
Operations
The Power Code node executes your custom JavaScript code in two modes:
- Run Once for All Items — Execute code once for all items. Access all items via
$input.all()oritemsvariable. - Run Once for Each Item — Execute code once for each item. Access current item via
$input.itemoritemvariable.
All 58+ libraries are pre-loaded as global variables — no require() needed.
Complete Library List (58 Working Libraries)
Data Processing
lodash (_), dayjs, moment (moment-timezone), dateFns (date-fns), dateFnsTz (date-fns-tz), bytes, ms, uuid (as uuidv4), nanoid
Validation & Parsing
joi, validator, Ajv, yup, zod, qs
Files & Documents
ExcelJS (exceljs) — supports streaming read/write for large files, xlsxtream — streaming XLSX reader, XLSX (xlsx) — classic XLSX read/write, Papa (papaparse), ini, toml
Web & HTTP
axios, cheerio, FormData (form-data)
Text & Content
Handlebars, marked, htmlToText (html-to-text), xml2js, XMLParser (fast-xml-parser), YAML, pluralize, slug, stringSimilarity (string-similarity), fuzzy (fuse.js)
Security & Crypto
CryptoJS (crypto-js), jwt (jsonwebtoken), bcrypt (bcryptjs), forge (node-forge)
Specialized
QRCode (qrcode), iban, phoneNumber (libphonenumber-js)
Natural Language
franc (franc-min), compromise
Async Control
pRetry (p-retry)
Data Operations
jsonDiff (json-diff-ts), cronParser (cron-parser)
Blockchain & Crypto
web3, solana (@solana/web3.js), bitcoin (bitcoinjs-lib), secp256k1 (@noble/secp256k1), bip39 (@scure/bip39), ccxt, coinGecko (coingecko-api-v3)
Media Processing
ytdl (@distube/ytdl-core), ffmpeg (fluent-ffmpeg), ffmpegStatic (ffmpeg-static)
Usage Examples
Data Transformation with lodash & dayjs
const firstItem = items[0];
const name = _.get(firstItem, 'name', 'World');
return {
greeting: 'Hello, ' + name + '!',
timestamp: dayjs().format('YYYY-MM-DD HH:mm:ss'),
};Web Scraping with axios & cheerio
const response = await axios.get('https://example.com/products');
const $ = cheerio.load(response.data);
const products = [];
$('.product-card').each((i, elem) => {
products.push({
title: $(elem).find('.title').text().trim(),
price: parseFloat($(elem).find('.price').text().replace('$', '')),
inStock: $(elem).find('.stock-status').hasClass('available'),
});
});
return _.filter(products, 'inStock');Excel File Processing (Streaming — supports large files)
// Read large Excel files with streaming (memory efficient)
const workbookReader = new ExcelJS.stream.xlsx.WorkbookReader(binaryData);
for await (const worksheetReader of workbookReader) {
for await (const row of worksheetReader) {
// Process each row without loading entire file into memory
const values = row.values;
}
}
// Write Excel files with streaming
const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ stream: fs.createWriteStream('output.xlsx') });
const sheet = workbook.addWorksheet('Report');
sheet.columns = [
{ header: 'Name', key: 'name' },
{ header: 'Email', key: 'email' },
];
items.forEach(item => sheet.addRow(item).commit());
await workbook.commit();JWT Authentication
const token = jwt.sign(
{ userId: user.id, email: user.email },
'your-secret-key',
{ expiresIn: '24h' }
);
const hashedPassword = await bcrypt.hash(password, 12);
return { token, hashedPassword };Data Validation
const schema = joi.object({
email: joi.string().email().required(),
age: joi.number().min(18).max(100),
});
const { error, value } = schema.validate($input.item.json);
if (error) throw new Error(`Validation failed: ${error.message}`);
return value;Compatibility
Compatible with n8n version 1.0+
Version History
1.2.0
- Added
xlsxlibrary for classic XLSX read/write support
1.1.0
- Initial release with 58 built-in libraries
