native-vm

1.0.5 • Public • Published

native-vm

node rewrite of vm module

Installation

npm i --save native-vm

Usage

Same as node vm!

Script

var Script = require( 'native-vm/lib/script' )

var script = new Script(function () {
    return NON_DEFINED_VAR;
})

// Generate a function that runs with specific context
var fn = script.runInContext({
    NON_DEFINED_VAR: 'yolo'
})

// Run fn
fn() // returns 'yolo'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.5
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.5
    4
  • 1.0.3
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i native-vm

Weekly Downloads

4

Version

1.0.5

License

GPL-3.0

Last publish

Collaborators

  • cuss