JSPM

  • Created
  • Published
  • Downloads 44911310
  • Score
    100M100P100Q229706F
  • License MIT

Package Exports

  • jiti

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jiti) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jiti

Require with just-in-time compiler for typescript and esm files

Features

  • Stable support for typescript and esm syntax
  • Provide sync interface to use inplace of esm or require
  • Super slim and zero dependency (~1.8M install size)
  • Works with CJS cache
  • Filesystem caching
  • Syntax detect to avoid extra transforms

Usage

const jiti = require('jiti')(__filename)

jiti('./path/to/file.ts')

How it works

Transform is based on babel and babel-preset-env

Development

  • Clone Repo
  • Run yarn
  • Run yarn build
  • Run yarn dev
  • Run node ./test/jiti.js

Roadmap

  • Basic working
  • File based caching
  • Syntax detect and fallback to CJS require
  • Configurable transform
  • Try sourcemap improvements
  • Simplify project build system

License

MIT