New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

context-eval

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

context-eval

JavaScript code execution context for the browser and wrapper around node vm module

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

context-eval

Simple execution context for node and the browser. In node it just creates a new context and runInContext in that context and in the browser it creates an iframe and hangs on to it until destroy is called.

install:

npm install context-eval

Use with browserify or node.

to run the tests:

npm test

test in browsers:

npm install karma -g
karma start

new Context(sandbox, parentElement)

sandbox (optional) is an object that would be shallowly copied into the execution context. parentElement (optional) is an element where the iframe can appended to, defautls to body.

Context#evaluate(code)

Evaluates code and returns result.

Context#destroy()

Does nothing in node but removes iframe in browser.

Context#extend(obj)

Extend the global object with obj

Context#getGlobal()

Returns the global object

License

MIT

Keywords

FAQs

Package last updated on 15 Aug 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc