JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 155
  • Score
    100M100P100Q108560F
  • License MIT

TS-ESNode is a Node.JS v13 Experimental loader hook for transpiling ESNext TypeScript to ESNext ESModule Node.JS Code on the fly

Package Exports

  • @k-foss/ts-esnode

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 (@k-foss/ts-esnode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

TS-ESNode

Renovate Status Code Quality code style: prettier Libraries.io dependency status for latest release, scoped npm package

This is a Node.JS Loader hook for Node.JS 13.9 or newer that transpiles TypeScript files into JavaScript using the getFormat, resolve, and transformSource hooks.

Usage

You should already have "type": "module" in your package.json

Install @k-foss/ts-esnode

Create a dev script in package.json

{
  "scripts": {
    "dev": "node --loader @k-foss/ts-esnode --experimental-specifier-resolution=node ./src/index.ts",
  }
}

Now when you run npm run dev then you should be running your TypeScript source without having to transpile it while still retaining Node.JS ESModule & ESNext module mode.

Development

Development is intened to be done using VSCode with the Remote - Containers extensions.

When you open this folder in VSCode you should get a notication to reopen in container. Click the reopen in container button to build the development contianer and launch VSCode in remote coding.

TODO

  • I would really like to remove the hack to support destructed imports of legacy node_modules, see this comment for more information.

  • Worker Threads to avoid the TypeScript compiling affecting main thread.

  • Performance improvements. (Better file/import finding.)

Testing

MUST HAVE NODE.JS v13.9 or newer

To try this out, clone repo

Install NPM modules

npm install

Run all tests under ./Testing/Tests/

npm test

All tests are run on all commits and PRs.