1.1.0 • Published 9 months ago

@nlib/tsm v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

@nlib/tsm

Thin .mts loader and test runner

.github/workflows/test.yml codecov

Install

npm install @nlib/tsm

Usage: Run *.ts/*.mts file

node --import=@nlib/tsm path/to/your/script.mts

@nlib/tsm exports register.mjs which registers loader.mjs. loader.mjs is a loader to customize the default module resolution. It exports the load function that loads modules with esbuild.

Usage: Run test files

Node.js added the stable node:test in v20. We can run tests with node --test. It searches for test files when a directory is specified as arguments. But it doesn't search for *.mts (even with the --experimental-loader option). So, you must pass the files one by one to run it.

The tsm-test will search for the test files for you and pass them to node --test.

npx tsm-test src
1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

10 months ago

0.1.4

10 months ago

0.1.2

12 months ago

0.1.3

12 months ago

0.1.1

2 years ago

0.1.0

2 years ago