skills/cli-scripting/nodejs/24/SKILL.md
Node.js 24 (Current) version-specific expertise. node:sqlite built-in stable, require() ESM stable, URLPattern built-in, V8 13.6 (RegExp.escape, Float16Array), npm 11, improved fetch streaming, improved permission model. WHEN: "Node 24", "Node.js 24", "node:sqlite", "DatabaseSync", "URLPattern", "RegExp.escape".
npx skillsauth add chrishuffman5/domain-expert cli-nodejs-24Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Node 24 LTS. Released May 2025, entered LTS October 2025, EOL April 2028. (Node 26 is the current "Current" release.)
| Feature | Status |
|---|---|
| require() for ES modules | Stable (no longer experimental) |
| URLPattern built-in | Added |
| V8 13.6 (RegExp.escape(), Float16Array) | Included |
| node:sqlite built-in SQLite | Stable |
| node:test full coverage reporting | Improved |
| npm 11 bundled | Updated |
| fetch streaming improvements | Improved |
| Permission model | Improved stability |
No need for better-sqlite3 or sql.js for simple use cases. Synchronous API.
import { DatabaseSync } from 'node:sqlite';
// In-memory database
const db = new DatabaseSync(':memory:');
// Create table
db.exec(`
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE,
created_at TEXT DEFAULT (datetime('now'))
)
`);
// Insert with prepared statement
const insert = db.prepare('INSERT INTO users (name, email) VALUES (?, ?)');
insert.run('Alice', '[email protected]');
insert.run('Bob', '[email protected]');
insert.run('Carol', '[email protected]');
// Query all rows
const all = db.prepare('SELECT * FROM users').all();
console.log(all);
// [{ id: 1, name: 'Alice', ... }, { id: 2, name: 'Bob', ... }, ...]
// Query single row
const alice = db.prepare('SELECT * FROM users WHERE name = ?').get('Alice');
console.log(alice); // { id: 1, name: 'Alice', email: '[email protected]', ... }
// Named parameters
const byEmail = db.prepare('SELECT * FROM users WHERE email = $email');
const user = byEmail.get({ $email: '[email protected]' });
// Update and get changes count
const update = db.prepare('UPDATE users SET name = ? WHERE id = ?');
const info = update.run('Robert', 2);
console.log(info.changes); // 1
// Delete
db.prepare('DELETE FROM users WHERE id = ?').run(3);
// Transaction (manual)
db.exec('BEGIN');
try {
insert.run('Dave', '[email protected]');
insert.run('Eve', '[email protected]');
db.exec('COMMIT');
} catch (err) {
db.exec('ROLLBACK');
throw err;
}
// File-based database
const fileDb = new DatabaseSync('/path/to/database.sqlite');
fileDb.exec('CREATE TABLE IF NOT EXISTS config (key TEXT PRIMARY KEY, value TEXT)');
fileDb.prepare('INSERT OR REPLACE INTO config (key, value) VALUES (?, ?)').run('version', '1.0.0');
fileDb.close();
#!/usr/bin/env node
import { DatabaseSync } from 'node:sqlite';
import { parseArgs } from 'node:util';
import path from 'node:path';
import os from 'node:os';
const DB_PATH = path.join(os.homedir(), '.mytool', 'data.sqlite');
const db = new DatabaseSync(DB_PATH);
db.exec(`CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY, title TEXT, done INTEGER DEFAULT 0
)`);
const { values, positionals } = parseArgs({
args: process.argv.slice(2),
options: { done: { type: 'boolean', short: 'd' } },
allowPositionals: true,
});
const [cmd, ...rest] = positionals;
if (cmd === 'add') {
db.prepare('INSERT INTO tasks (title) VALUES (?)').run(rest.join(' '));
console.log('Task added.');
} else if (cmd === 'list') {
const tasks = db.prepare('SELECT * FROM tasks ORDER BY id').all();
tasks.forEach(t => console.log(` ${t.done ? '[x]' : '[ ]'} ${t.id}: ${t.title}`));
} else if (cmd === 'done') {
db.prepare('UPDATE tasks SET done = 1 WHERE id = ?').run(Number(rest[0]));
console.log('Marked done.');
} else {
console.log('Usage: mytool <add|list|done> [args]');
}
db.close();
// In a CJS file — no flag or warning needed in Node 24:
const { helper } = require('./esm-module.mjs');
const chalk = require('chalk'); // ESM-only packages now work in CJS
// This enables full interop between CJS and ESM codebases
// No more "ERR_REQUIRE_ESM" errors for most packages
// Built-in URLPattern (previously web-only)
const pattern = new URLPattern({ pathname: '/users/:id' });
const match = pattern.exec('https://example.com/users/42');
console.log(match.pathname.groups.id); // '42'
const apiPattern = new URLPattern({ pathname: '/api/:version/:resource' });
const result = apiPattern.exec('https://api.example.com/api/v2/orders');
console.log(result.pathname.groups); // { version: 'v2', resource: 'orders' }
// RegExp.escape() — safely escape user input for RegExp
const userInput = 'hello.world?';
const safe = new RegExp(RegExp.escape(userInput)); // escapes . and ?
console.log(safe.test('hello.world?')); // true
console.log(safe.test('helloXworldX')); // false
// Float16Array — half-precision floating point
const f16 = new Float16Array([1.5, 2.5, 3.5]);
console.log(f16); // Float16Array [1.5, 2.5, 3.5]
When migrating from Node 22 to Node 24:
require() ESM is now stable -- remove --experimental-require-module flagnode:sqlite is stable -- evaluate replacing better-sqlite3 for simple use casesURLPattern is available -- can replace path-matching regexRegExp.escape() is available -- replace manual escaping helperstools
kubectl command-line usage and scripting: kubeconfig and context management, output formats (jsonpath, custom-columns, go-template), all major verbs (get, describe, apply, delete, exec, logs, port-forward, rollout, scale, drain), workload resources, config/storage, networking, RBAC, node management, debugging (CrashLoopBackOff, ImagePullBackOff, OOMKilled), and scripting patterns (dry-run, diff, wait, jq, kustomize). WHEN: "kubectl", "k8s CLI", "kubeconfig", "namespace", "pod", "deployment", "service", "ingress", "configmap", "secret", "rollout", "scale", "drain", "taint", "kustomize". Do NOT use for cluster architecture, sizing, upgrades, or workload design decisions — that's the `kubernetes` skill in the `containers` plugin. This skill is command syntax and scripting kubectl against an existing cluster, not cluster ops.
tools
Bash 5.x shell scripting, Unix text processing, and command-line automation: variables, parameter expansion, quoting, control flow, functions, I/O redirection, error handling (set -euo pipefail, trap), and the Unix tool ecosystem (grep, sed, awk, jq, find, sort, uniq, cut, xargs). Covers process management, networking (curl, ssh, rsync, nc), file locking (flock), parallel execution, and production script patterns. WHEN: "Bash", "bash", "shell", "sh", ".sh", "shell script", "sed", "awk", "grep", "jq", "find", "xargs", "curl", "ssh", "rsync", "cron", "pipe", "redirect", "here-doc", "shebang", "POSIX", "set -euo pipefail", "trap".
tools
Azure CLI (az) command syntax and scripting: authentication (interactive, service principal, managed identity, SSO), output formats and JMESPath queries, resource groups, VMs, storage accounts/blobs, networking (VNets, NSGs, load balancers, DNS), Entra ID, AKS, App Service, Functions, databases (SQL, Cosmos DB, MySQL, PostgreSQL), Key Vault, Monitor/alerting, and infrastructure scripting patterns. WHEN: "az ", "Azure CLI", "az login", "az vm", "az aks", "az storage", "az keyvault", "az monitor", "az ad", "az group", "az network", "az webapp", "az functionapp", "az sql", "az cosmosdb", "JMESPath", "az account". Do NOT use for Azure architecture, landing zones, or multi-subscription strategy — that's the `cloud-platforms` plugin. This skill is about command syntax and scripting the CLI, not deciding what to provision.
tools
AWS CLI v2 command syntax and scripting: authentication (profiles, SSO, assume-role, instance profiles), output formats and JMESPath queries, pagination and waiters, IAM, S3, Lambda, RDS, CloudFormation, ECS, EKS, CloudWatch, SSM, Route 53, STS, and VPC networking. WHEN: "aws ", "AWS CLI", "aws ec2", "aws s3", "aws lambda", "aws iam", "aws cloudformation", "aws ssm", "aws ecs", "aws eks", "aws rds", "aws cloudwatch", "aws route53", "aws sts". Do NOT use for AWS architecture, service selection, multi-account strategy, or FinOps — that's the `cloud-platforms` plugin. This skill is about command syntax and scripting the CLI, not deciding what to provision.