Node.js Package Preparation
A public package needs a deliberate export surface, included-file policy and version plan. A tutorial should not publish to a registry merely to demonstrate those concepts.
How it works
Separate a reusable library package from a private application. The manifest below is an original proposed library contract; it is inspected as data and never sent to npm. Before a real release, review npm pack --dry-run, included licence/readme files, exported paths, test results, package-name ownership and release credentials. A dry run is a review aid, not registry publication or proof that the package contains no sensitive material.
Run the code
Run this example locally with Node.js. The exact sources are reviewed on Node 22.15.1 and Node 24.22.1 unless a specialised lab states otherwise. Save the complete source as package-release.mjs in a separate empty exercises folder and run node package-release.mjs. There is no Node.js browser runner on Bhylu; the plain JavaScript playground does not provide these filesystem, server or process APIs.
Download the complete source. Ordinary Node scripts need no Apache, PHP or MySQL service. File examples own their temporary folders; network fixtures use loopback and available temporary ports.
Example
const release = {
name: 'example-field-kit-rules',
version: '0.1.0',
type: 'module',
exports: { '.': './src/index.mjs' },
files: ['src'],
license: 'MIT',
};
console.log(release.exports['.']);
console.log(release.files.join(','));
console.log('Published:', false);
Expected result
./src/index.mjs src Published: false
The public entry path and included source folder are explicit. The name is an illustrative value, not a reservation of a registry name or a statement of legal clearance. The package lab checks an actual local dry-run inventory separately.
Use the Node.js API reference for the precise version contract.