Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nlib/tsm

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlib/tsm

Thin .ts/.mts loader & test runner

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
221
decreased by-15.65%
Maintainers
1
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 14 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc