1.5.6 • Published 5 months ago

ts-interpreter.js v1.5.6

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

ts-interpreter.js TypeScript Runtime Compiler

This package will allow you to use require on any .ts files from any .js files using our runtime compiler!

Installation

API

npm i ts-interpreter.js

CLI - scroll down for CLI usages

npm i ts-interpreter.js -g

Coverage

  • Full Enum Support
  • Array / Object methods
  • Class methods
  • export / import conversion to module.exports
  • Statements (label, if, while, etc.)
  • Try / Catch / Finally handle
  • Assignments
  • Keywords
  • Operators
  • Expressions

Samples

Click here to view samples of compiled TS to JS

Tests & Comparisons

  • tsc compiler: 1.159s - 1.381s (8 files)
  • ts-node runtime compiler: 1.052s - 1.235s (8 files)
  • ts-interpreter.js runtime compiler: 32.527ms - 507.492ms (8 files)

API Usage

index.js

require('ts-interpreter.js'); // register .ts extension and runtime compiler
const package = require('./main'); // main.ts gets compiled almost instant during runtime

console.log(package.whoami()); // ts-interpreter.js

main.ts

export function whoami(): string|any {
	return 'ts-interpreter.js';
}

CLI Usage

file        : tsi-cli <input.ts> <out.js>
auto        : tsi-cli <input.ts> - # replaces - to <input.ts>.js
console     : tsi-cli <input.ts> --
project-dist: tsi-cli project-dist
run         : tsi-cli run <input.js/input.ts>

Packages

@typescript-eslint/parser

vm

1.5.5

5 months ago

1.5.6

5 months ago

1.5.4

9 months ago

1.5.3

10 months ago

1.5.2

10 months ago

1.4.3

1 year ago

1.5.1

1 year ago

1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago