JSPM

transplant-js

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

Write strictly-typed Javascript code

Package Exports

  • transplant-js

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

Readme

What is this ?

transplant.js ( or tx.js ) is a pseudo compiler for Javascript with TypeScript.

It enables typenames for variables such as int, double, string and bool.

tx.js files are created with the .tx extension.

Installation

tx.js uses the TypeScript compiler so make sure you have it installed

Use npx install so the package is automatically executed to use the transplant.js compiler txc

-- Locally in your project

$ npm install -D typescript
$ npx install -D transplant-js

-- Or globally with TypeScript

$ npm install -g typescript
$ npx install -g tx.js

How to run

To compile test.tx run

$ txc test.tx

This command will create a test.ts and a test.js file. You can do whatever you want with them! 🥳 + transplant.js always keeps the same file name. + Error handling is done by the TypeScript compiler.

More to come

  • Automatic conversion to let/const
  • type check by Typescript
  • protected namespaces
  • syntax highlighter
  • and more..