Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

node

БесплатноБез исполняемых скриптовНе проверен

Node.js is the JavaScript runtime that runs servers, command-line tools and build scripts outside the browser. Use this skill when a user asks which Node.js…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Node.js — run JavaScript and TypeScript with the batteries included

Overview

Modern Node.js ships with a test runner, a file watcher, .env loading, fetch, a SQLite module, an argument parser, TypeScript type stripping and an opt-in permission model. A project that needs none of the old helper packages (jest, nodemon, dotenv, ts-node, node-fetch, minimist) for basic work is common today. This skill covers choosing a release line and using these built-ins correctly. It does not cover frameworks (see fastify, hono, nestjs) or switching between Node versions (see nvm and mise).

Instructions

Choose the release line

Even-numbered releases become LTS (long-term support); odd-numbered ones are short-lived and are not for production. Read the live data instead of trusting memory:

curl -s https://nodejs.org/dist/index.json | python3 -c "
import json, sys
seen = set()
for r in json.load(sys.stdin):
    major = r['version'].split('.')[0]
    if r['lts'] and major not in seen:
        seen.add(major); print(r['version'], r['lts'], r['date'])"

As of 2026-11-05 the schedule (https://github.com/nodejs/Release) is:

Line Status End of life
26 "Lithium" Active LTS since 2026-10-28 2029-04-30
24 "Krypton" Maintenance LTS since 2026-10-20 2028-04-30
22 "Jod" Maintenance LTS 2027-04-30
20 "Iron" End of life since 2026-04-30 —
27 alpha; becomes Current in April 2027 —

Rule: new services start on the newest Active LTS (26); existing ones stay on a supported LTS and plan the next jump before the end-of-life date. Never deploy an end-of-life line or an odd-numbered release.

Install the official binary and verify it

When no version manager is available, download the tarball and check it against the published checksums:

V=v26.13.0
curl -fLO https://nodejs.org/dist/$V/node-$V-linux-x64.tar.xz
curl -fLO https://nodejs.org/dist/$V/SHASUMS256.txt
grep "node-$V-linux-x64.tar.xz" SHASUMS256.txt | sha256sum -c -
mkdir -p "$HOME/opt/node-$V"
tar -xJf node-$V-linux-x64.tar.xz -C "$HOME/opt/node-$V" --strip-components=1
"$HOME/opt/node-$V/bin/node" --version

The tarball contains node, npm and npx (Corepack is not included; install a package manager with npm install -g if you need one). For several versions side by side, use the nvm skill.

Test with the built-in runner

node --test discovers test files by naming convention (such as *.test.ts and anything under test/), runs each file in its own process, and exits non-zero on failure.

// test/price.test.ts
import { test, describe } from 'node:test';
import assert from 'node:assert/strict';
import { total } from '../src/price.ts';

describe('total', () => {
  test('sums quantity times price', () => {
    assert.equal(total([{ sku: 'KB-104', cents: 4900, qty: 2 }]), 9800);
  });
  test('empty cart is zero', () => assert.equal(total([]), 0));
});
node --test                                   # run everything
node --test --test-name-pattern='empty'       # only matching test names
node --test --experimental-test-coverage      # table of line/branch/function coverage
node --test --test-rerun-failures=state.json  # second run re-executes only what failed
node --test --test-reporter=spec              # spec | tap | dot | junit | lcov

Inside a test, t.mock.fn() creates spies, t.mock.timers.enable({ apis: ['Date'], now: 1_700_000_000_000 }) fakes the clock, and t.assert.snapshot(value) compares with a <file>.snapshot file that node --test --test-update-snapshots writes.

Restart on change and load .env files

node --watch --env-file=.env src/server.ts      # restarts when imported files change
node --watch-path=./src --watch-path=./config src/server.ts   # watch extra paths
node --env-file=.env --env-file-if-exists=.env.local src/server.ts  # later file wins; second may be absent

Variables already set in the shell win over the file, so PORT=9000 node --env-file=.env app.js uses 9000. Inside code, process.loadEnvFile('.env') loads a file at runtime and util.parseEnv(text) parses a string. Keep .env out of git.

Run TypeScript without a build step

Node strips type annotations when it runs a .ts, .mts or .cts file; no flag is needed on 26.13.0 (run node --help | grep strip-types on other versions before relying on it).

node src/hello.ts -q 3
node --check src/price.ts      # syntax check only (no type checking)

Stripping only erases types, so the code must use "erasable" syntax:

  • Import local files with the real extension: import { total } from './price.ts' (without .ts you get ERR_MODULE_NOT_FOUND).
  • Type-only imports need the type keyword: import { total, type LineItem } from './price.ts'. A plain import { LineItem } fails at link time.
  • enum, namespace and constructor parameter properties (constructor(private x: number)) throw `ERR_UNSUPPO
Полный SKILL.md на GitHub

Установить node в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл node?

Node.js is the JavaScript runtime that runs servers, command-line tools and build scripts outside the browser. Use this skill when a user asks which Node.js version to run, how to test with `node --test`, restart on change with `--watch`, load a `.env` file, run TypeScript files without a build step, restrict a script with the permission model, mix ESM and CommonJS, or attach a debugger with `--inspect`. Covers the 2026 release lines (26 Active LTS, 24 and 22 maintenance) and the built-in modules that replace common npm packages.

Как установить скилл node?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл node запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить node с