665">92ae4370cd config лет назад: 3 general-template.php 92ae4370cd config лет назад: 3 global-styles-and-settings.php 92ae4370cd config лет назад: 3 http.php 92ae4370cd config лет назад: 3 https-detection.php 92ae4370cd config лет назад: 3 https-migration.php d01d7cf85d first commit лет назад: 4 kses.php 92ae4370cd config лет назад: 3 l10n.php 92ae4370cd config лет назад: 3 link-template.php 92ae4370cd config лет назад: 3 load.php 92ae4370cd config лет назад: 3 locale.php d01d7cf85d first commit лет назад: 4 media-template.php 92ae4370cd config лет назад: 3 media.php 92ae4370cd config лет назад: 3 meta.php 92ae4370cd config лет назад: 3 ms-blogs.php d01d7cf85d first commit лет назад: 4 ms-default-constants.php 92ae4370cd config лет назад: 3 ms-default-filters.php 92ae4370cd config лет назад: 3 ms-deprecated.php 92ae4370cd config лет назад: 3 ms-files.php 92ae4370cd config лет назад: 3 ms-functions.php 92ae4370cd config лет назад: 3 ms-load.php 92ae4370cd config лет назад: 3 ms-network.php 92ae4370cd config лет назад: 3 ms-settings.php d01d7cf85d first commit лет назад: 4 ms-site.php 92ae4370cd config лет назад: 3 nav-menu-template.php 92ae4370cd config лет назад: 3 nav-menu.php 92ae4370cd config лет назад: 3 option.php 92ae4370cd config лет назад: 3 pluggable-deprecated.php d01d7cf85d first commit лет назад: 4 pluggable.php 92ae4370cd config лет назад: 3 plugin.php 92ae4370cd config лет назад: 3 post-formats.php d01d7cf85d first commit лет назад: 4 post-template.php 92ae4370cd config лет назад: 3 post-thumbnail-template.php 92ae4370cd config лет назад: 3 post.php 92ae4370cd config лет назад: 3 query.php d01d7cf85d first commit лет назад: 4 registration-functions.php d01d7cf85d first commit лет назад: 4 registration.php d01d7cf85d first commit лет назад: 4 rest-api.php 92ae4370cd config лет назад: 3 revision.php 92ae4370cd config лет назад: 3 rewrite.php 92ae4370cd config лет назад: 3 robots-template.php 92ae4370cd config лет назад: 3 rss-functions.php d01d7cf85d first commit лет назад: 4 rss.php 92ae4370cd config лет назад: 3 script-loader.php 92ae4370cd config лет назад: 3 session.php d01d7cf85d first commit лет назад: 4 shortcodes.php d01d7cf85d first commit лет назад: 4 sitemaps.php d01d7cf85d first commit лет назад: 4 spl-autoload-compat.php d01d7cf85d first commit лет назад: 4 taxonomy.php 92ae4370cd config лет назад: 3 template-canvas.php 92ae4370cd config лет назад: 3 template-loader.php d01d7cf85d first commit лет назад: 4 template.php d01d7cf85d first commit лет назад: 4 theme-i18n.json 92ae4370cd config лет назад: 3 theme-templates.php 92ae4370cd config лет назад: 3 theme.json 92ae4370cd config лет назад: 3 theme.php 92ae4370cd config лет назад: 3 update.php 92ae4370cd config лет назад: 3 user.php 92ae4370cd config лет назад: 3 vars.php 92ae4370cd config лет назад: 3 version.php 92ae4370cd config лет назад: 3 widgets.php 92ae4370cd config лет назад: 3 wlwmanifest.xml d01d7cf85d first commit лет назад: 4 wp-db.php 92ae4370cd config лет назад: 3 wp-diff.php d01d7cf85d first commit лет назад: 4 tum/tmt_learning - Gogs: Simplico Git Service

No Description

README.md 3.2KB

jiti

Runtime typescript and ESM support for Node.js

version downloads size

Features

  • Seamless typescript and ESM syntax support
  • Seamless interoperability between ESM and CommonJS
  • Synchronous API to replace require
  • Super slim and zero dependency
  • Smart syntax detection to avoid extra transforms
  • CommonJS cache integration
  • Filesystem transpile hard cache
  • V8 compile cache
  • Custom resolve alias

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

  • Type: Boolean
  • Default: false
  • Environment Variable: JITI_DEBUG

Enable debug to see which files are transpiled

cache

  • Type: Boolean | String
  • Default: true
  • Environment Variable: JITI_CACHE

Use transpile cache

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

esmResolve

  • Type: Boolean | String
  • Default: false
  • Environment Variable: JITI_ESM_RESOLVE

Using esm resolution algorithm to support import condition.

transform

  • Type: Function
  • Default: Babel (lazy loaded)

Transform function. See src/babel for more details

sourceMaps

  • Type: Boolean
  • Default false
  • Environment Variable: JITI_SOURCE_MAPS

Add inline source map to transformed source for better debugging.

interopDefault

  • Type: Boolean
  • Default: false

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

alias

  • Type: Object
  • Default: -
  • Environment Variable: JITI_ALIAS

Custom alias map used to resolve ids.

nativeModules

  • Type: Array
  • Default: ['typescript`]
  • Environment Variable: JITI_NATIVE_MODULES

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

transformModules

  • Type: Array
  • Default: []
  • Environment Variable: JITI_TRANSFORM_MODULES

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

Development

  • Clone this repository
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run pnpm dev
  • Run pnpm jiti ./test/path/to/file.ts

License

MIT. Made with 💖