1.0.3 • Published 1 year ago

ts-simple-interpreter v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

🚀 Quick start

  1. Install the package to your project
    npm install ts-simple-interpreter 
  2. Import the executeTS method to js/ts component
    import { executeTS } from 'ts-simple-interpreter'
    The return value will be the output of the executed result, similar to the output you would see in the console:
    const result = executeTS('your TypeScript code here');
    console.log(result); // This will log the output of the executed code

Example Usage

Here’s a simple example demonstrating how to use the executeTS method:

import { executeTS } from 'ts-simple-interpreter';

const tsCode = `
    const add = (a: number, b: number): number => {
        return a + b;
    };
    add(2, 3);
`;

const result = executeTS(tsCode);
console.log(result); // Expected output: 5
1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago