peach a19a732be8 commit message | %!s(int64=2) %!d(string=hai) anos | |
---|---|---|
.. | ||
bin | %!s(int64=2) %!d(string=hai) anos | |
dist | %!s(int64=2) %!d(string=hai) anos | |
lib | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
package.json | %!s(int64=2) %!d(string=hai) anos | |
register.js | %!s(int64=2) %!d(string=hai) anos |
Runtime typescript and ESM support for Node.js (CommonJS)
require
const jiti = require('jiti')(__filename)
jiti('./path/to/file.ts')
You can also pass options as second argument:
const jiti = require('jiti')(__filename, { debug: true })
jiti index.ts
# or npx jiti index.ts
node -r jiti/register index.ts
Alternatively, you can register jiti
as a require hook programmatically:
const jiti = require('jiti')()
const unregister = jiti.register()
debug
false
JITI_DEBUG
Enable debug to see which files are transpiled
cache
true
JITI_CACHE
Use transpile cache
If set to true
will use node_modules/.cache/jiti
(if exists) or {TMP_DIR}/node-jiti
esmResolve
false
JITI_ESM_RESOLVE
Using esm resolution algorithm to support import
condition.
transform
Transform function. See src/babel for more details
sourceMaps
false
JITI_SOURCE_MAPS
Add inline source map to transformed source for better debugging.
yarn
yarn build
yarn dev
yarn jiti ./test/path/to/file.ts
MIT. Made with 💖