DEV Community

Acid Coder
Acid Coder

Posted on • Edited on

TS-Hajime: Effortlessly Bootstrap TypeScript NPM Libraries

TypeScript library setup takes longer than writing the library.

Want to publish a TypeScript npm package, but before you get to the fun part, you have to configure:

  • bundler to support ESM + CJS + types

  • package.json entries

  • linting and formatting

  • tests, CI, pre-commit hooks, sane editor defaults

  • npx command

  • tsconfig

  • script runner

For this, I made ts-hajime, using modern tools only:

  • Biome instead of ESLint + Prettier for linting and formatting

  • tsdown for dual ESM/CJS output and types

  • Vitest for tests

  • GitHub Actions for CI

  • Husky + lint-staged for pre-commit hooks

  • sane VSCode settings

  • sane tsconfig

  • npx template script and template code

  • tsx for running .ts script directly without compilation

Minimal yet essential setup, all preconfigured, all customizable.

You get everything in one command: npx ts-hajime

https://github.com/tylim88/ts-hajime

Top comments (1)

Collapse
 
tylim88 profile image
Acid Coder

updated to new version 0.4