Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukeed/tsm
TypeScript Module Loader
https://github.com/lukeed/tsm
Last synced: 20 days ago
JSON representation
TypeScript Module Loader
- Host: GitHub
- URL: https://github.com/lukeed/tsm
- Owner: lukeed
- License: mit
- Created: 2021-10-05T05:00:03.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-20T17:10:20.000Z (10 months ago)
- Last Synced: 2024-10-03T23:04:05.090Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 113 KB
- Stars: 1,179
- Watchers: 12
- Forks: 19
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license
Awesome Lists containing this project
- awesome-node-esm - tsm - TypeScript Module Loader (Tools)
README
TypeScript Module Loader## Features
* Supports `node ` usage
* Supports [ESM `--loader`](https://nodejs.org/api/esm.html#esm_loaders) usage†
* Supports [`--require` hook](https://nodejs.org/api/cli.html#cli_r_require_module) usage
* Optional [configuration](/docs/configuration.md) file for per-extension customization> † The ESM Loader API is still **experimental** and will change in the future.
## Install
```sh
# install as project dependency
$ npm install --save-dev tsm# or install globally
$ npm install --global tsm
```## Usage
> **Note:** Refer to [`/docs/usage.md`](/docs/usage.md) for more information.
```sh
# use as `node` replacement
$ tsm server.ts# forwards any `node` ENV or flags
$ NO_COLOR=1 tsm server.ts --trace-warnings# use as `--require` hook
$ node --require tsm server.tsx
$ node -r tsm server.tsx# use as `--loader` hook
$ node --loader tsm main.jsx
```## License
MIT © [Luke Edwards](https://lukeed.com)