Socket
Socket
Sign inDemoInstall

eval-module

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eval-module

Create a new module dynamically, at runtime, from source.


Version published
Weekly downloads
7
Maintainers
1
Install size
1.30 MB
Created
Weekly downloads
 

Readme

Source

Eval Module

Create a new module dynamically, at runtime, from source.

var dynamicModule= require("eval-module")("module.exports= {a: 'ok'}")
console.log(dynamicModule.a) //=> ok

Try it! ./.example/aok or ./.test/aok.js!

Implementation

The implementation is the only possible thing I could think up, which is using temporary files/directories. EvalModule tracks all creations and cleans up those sources at the process exit event.

Keywords

FAQs

Last updated on 09 Nov 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc