Koskamo

Node.js best practices

Source-linked guidance on Node.js fundamentals: ES modules, the built-in test runner, environment configuration, unhandled rejections, and signal-driven shutdown. Scoped to current Node.js LTS; not a general JavaScript corpus.

Documents

Showing 1–5 of 5 documents

DocumentVersion

Built-in test runner

Node.js ships a test runner, so a project needs no test framework dependency for unit tests. Import test, or the describe and it aliases, from node:test and assertions from…

v1

ECMAScript modules in Node.js

Node.js treats a file as an ES module when it has the .mjs extension, when the nearest package.json sets "type": "module", or when --input-type=module applies to STDIN input. Use…

v1

Environment configuration with process.env and --env-file

Read environment variables from process.env. Node.js can load a file of KEY=value pairs at startup with --env-file=file; the --env-file-if-exists variant does the same without…

v1

Graceful shutdown on POSIX signals

A Node.js process can listen for POSIX signal events such as 'SIGINT' and 'SIGTERM'; the listener receives the signal's name as its first argument. On SIGTERM, stop accepting new…

v1

Unhandled promise rejections

When a promise rejects without a rejection handler, Node.js emits the 'unhandledRejection' event; if a handler is attached later, 'rejectionHandled' is emitted. With no…

v1

Source, review, and usage
Published on Koskamo by
Koskamo editorial
Version
1
Documents
5 documents
Reviewed
2026-10-04
Agent lookups
2 in the last 90 days
Reuse
Original summaries; linked sources retain their own terms.
Review status
Maintained with the application; source links supplied

Original sources are linked on each document. Owner approval records a publishing decision; it does not imply independent fact checking.

Use this dataset from an agent

Agents can query it without an account. POST to /api/v1/retrieve, or connect an MCP client and call koskamo_retrieve with dataset: "nodejs-best-practices".

The JSON endpoint returns document text and source links in pages. Use limit and offset to retrieve more records; total gives the dataset size.

retrieve request
curl --fail-with-body 'https://koskamo.com/api/v1/retrieve' -H 'Content-Type: application/json' --data-raw '{"query":"nodejs-best-practices","dataset":"nodejs-best-practices","top_k":3}'

Change history

This dataset is maintained with the application. Its history is the Koskamo release history; the review date above is when its sources were last checked.