/ student-intifada / node_modules / jiti /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]bin/a year ago -  
[DIR]dist/a year ago -  
[DIR]lib/a year ago -  
[   ]LICENSEa year ago1.1K 
[TXT]README.mda year ago3.8K595aea1 more query options + view options [كارل مبارك]
[   ]package.jsona year ago2.8Kafd0ccc remove unused [كارل مبارك]
[   ]register.jsa year ago 47  
README.md

jiti

npm version npm downloads bundle License

Runtime Typescript and ESM support for Node.js.

[!IMPORTANT] This is the support branch for jiti v1. Check out jiti/main for the latest version and unjs/jiti#174 for the roadmap.

Features

Usage

Programmatic

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 });

CLI

jiti index.ts
# or npx jiti index.ts

Register require hook

node -r jiti/register index.ts

Alternatively, you can register jiti as a require hook programmatically:

const jiti = require("jiti")();
const unregister = jiti.register();

Options

debug

Enable debug to see which files are transpiled

cache

Use transpile cache

If set to true will use node_modules/.cache/jiti (if exists) or {TMP_DIR}/node-jiti

esmResolve

Using esm resolution algorithm to support import condition.

transform

Transform function. See src/babel for more details

sourceMaps

Add inline source map to transformed source for better debugging.

interopDefault

Return the .default export of a module at the top-level.

alias

Custom alias map used to resolve ids.

nativeModules

List of modules (within node_modules) to always use native require for them.

transformModules

List of modules (within node_modules) to transform them regardless of syntax.

experimentalBun

Enable experimental native Bun support for transformations.

Development

License

MIT. Made with 💖

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80