JSPM

modernscript

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

Sucrase preset for typescript and esm

Package Exports

  • modernscript
  • modernscript/register

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

Readme

modernscript

Run modern javascript/typescript without thinking about it.

This sets up some sucrase hooks to process typescript and import/export statements, including in node_modules.

Usage

Use the require hook:

node -r modernscript/register myscript.ts

Use runjs command

runjs myscript.ts

Credits

  • Sucrase: Super-fast alternative to Babel for when you can target modern JS runtimes
  • Pirates: Properly hijack require