New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vm-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vm-utils

VM Utilities for NodeJS

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

vm-utils

A NodeJS VM utilities

Features

Class VMContext

  • Method call: execute a JS code directly
  • Method getCall: create a JS function to execute a JS code
  • Method run: similar to call, but with code from vmContext.__filename
  • Method getRun: similar to getCall, but with code from vmContext.__filename

Other

  • Function makeProcess: help VMContext to build a fake process
  • Function makeGlobal: help VMContext to create some global variables

Examples

var VMContext = require('vm-utils/vm-context.js');
var vmContext = new VMContext({
	console: global.console,
	count: 0
});
var calc = vmContext.getCall('console.log(count++)');
for (let i = 10; i; --i) calc();

Keywords

vm-utils

FAQs

Package last updated on 22 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts