run-jsc
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Run Jsc Travis CI Build Status

Run JScript code and retrieve the result.

NPM Badge

Install

npm install run-jsc

Usage

const runJsc = require("run-jsc");
 
(async () => {
    const result = await runJsc((unicorn, horse) => {
        return `I love ${unicorn} & ${horse}`;
    }, ['🦄', '🐴']);
    
    console.log(result);
    //=> 'I love 🦄 & 🐴'
})()

API

runJsc(input, args?, options?)

input

Type: function | string

The input function.

args

Type: array
Default: []

The arguments to pass to the function.

options

Type: object

cwd

Type: string
Default: process.cwd()

Current working directory of the child process.

Similar

Readme

Keywords

Package Sidebar

Install

npm i run-jsc

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

5.57 kB

Total Files

6

Last publish

Collaborators

  • richienb