Gathering detailed insights and metrics for ts-node-dev
Gathering detailed insights and metrics for ts-node-dev
Gathering detailed insights and metrics for ts-node-dev
Gathering detailed insights and metrics for ts-node-dev
wds
A reloading dev server for server side TypeScript projects. Compiles TypeScript _real_ fast, on demand, using ESM loaders and `require.extensions`. Similar to and inspired by `ts-node-dev` and `tsx`.
tsconfig-paths
Load node modules according to tsconfig paths, in run-time or via API.
sucrase
Super-fast alternative to Babel for when you can target modern JS runtimes
vite-node
Vite as Node.js runtime
Compiles your TS app and restarts when files are modified.
npm install ts-node-dev
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3,430 Stars
543 Commits
123 Forks
14 Watching
4 Branches
43 Contributors
Updated on 16 Nov 2024
Minified
Minified + Gzipped
TypeScript (98.62%)
JavaScript (1.38%)
Cumulative downloads
Total Downloads
Last day
-6.8%
220,605
Compared to previous day
Last week
2.6%
1,270,471
Compared to previous week
Last month
18.2%
5,187,433
Compared to previous month
Last year
4.4%
50,131,602
Compared to previous year
10
2
Tweaked version of node-dev that uses ts-node under the hood.
It restarts target node process when any of required files changes (as standard node-dev
) but shares Typescript compilation process between restarts. This significantly increases speed of restarting comparing to node-dev -r ts-node/register ...
, nodemon -x ts-node ...
variations because there is no need to instantiate ts-node
compilation each time.
yarn add ts-node-dev --dev
npm i ts-node-dev --save-dev
ts-node-dev [node-dev|ts-node flags] [ts-node-dev flags] [node cli flags] [--] [script] [script arguments]
So you just combine node-dev and ts-node options (see docs of those packages):
ts-node-dev --respawn --transpile-only server.ts
There is also short alias tsnd
for running ts-node-dev
:
tsnd --respawn server.ts
Look up flags and options can be used in ts-node's docs.
Also there are additional options specific to ts-node-dev
:
--ignore-watch
- (default: []) - files/folders to be ignored by node-dev
. But this behaviour is enhanced: it also supports regular expression in the ignore strings and will check absolute paths of required files for match.
--deps
- Also watch node_modules
; by default watching is turned off
--debug
- Some additional [DEBUG] output
--quiet
- Silent [INFO] messages
--interval
- Polling interval (ms) - DOESN'T WORK CURRENTLY
--debounce
- Debounce file change events (ms, non-polling mode)
--clear
(--cls
) - Will clear screen on restart
--watch
- Explicitly add arbitrary files or folders to watch and restart on change (list separated by commas, chokidar patterns)
--exit-child
- Adds 'SIGTERM' exit handler in a child process.
--rs
- Allow to restart with "rs" line entered in stdio, disabled by default.
--notify
- to display desktop-notifications (Notifications are only displayed if node-notifier
is installed).
--cache-directory
- tmp dir which is used to keep the compiled sources (by default os tmp directory is used)
If you need to detect that you are running with ts-node-dev
, check if process.env.TS_NODE_DEV
is set.
Points of notice:
If you want desktop-notifications you should install node-notifier
package and use --notify
flag.
Especially for large code bases always consider running with --transpile-only
flag which is normal for dev workflow and will speed up things greatly. Note, that ts-node-dev
will not put watch handlers on TS files that contain only types/interfaces (used only for type checking) - this is current limitation by design.
--ignore-watch
will NOT affect files ignored by TS compilation. Use --ignore
option (or TS_NODE_IGNORE
env variable) to pass RegExp strings for filtering files that should not be compiled, by default /node_modules/
are ignored.
Unknown flags (node
cli flags are considered to be so) are treated like string value flags by default. The right solution to avoid ambiguity is to separate script name from option flags with --
, for example:
ts-node-dev --inspect -- my-script.ts
The good thing is that ts-node-dev
watches used tsconfig.json
file, and will reinitialize compilation on its change, but you have to restart the process manually when you update used version of typescript
or make any other changes that may effect compilation results.
If you have an issue, please create one. But, before:
--files
option enabled (see ts-node docs)--debug
flag and see the outputCurrently versioning is not stable and it is still treated as pre-release. You might expect some options API changes. If you want to avoid unexpected problems it is recommended to fixate the installed version and update only in case of issues, you may consult CHANGELOG for updates.
MIT.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 2/27 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More