A TypeScript library template using Node.js.
- Node.js 24 or newer
npx giget gh:bentruyman/templates/node/lib my-lib
cd my-lib
npm installUpdate package.json with your project details:
name- Your package namedescription- What your library doesexports- The entrypoints you want to publish
Replace the example implementation in src/index.ts with your library code.
| Script | Description |
|---|---|
npm run build |
Compile the library to dist/ |
npm run format |
Format code with oxfmt and apply oxlint fixes |
npm run lint |
Check formatting and lint the template |
npm test |
Run tests with Vitest |
npm run typecheck |
Type-check with TypeScript |
npm run verify |
Run lint, typecheck, test, and build |
npm run release |
Publish a new version with release-it |
Run tests while iterating:
npm exec vitest --watch- Update
package.jsonname and exports fields - Run
npm run releaseto build, tag, and publish to npm