New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

array-inline

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
Package version was removed
This package version has been unpublished, mostly likely due to security reasons
Malware was recently detected in this package.

Affected versions:

0.0.0-stage0.0.1-security2.0.5

array-inline

Evaluate Node.js module source from a string, buffer, or VM script — like require(), without a file.

unpublished
npmnpm
Version
2.0.5
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

array-inline

Evaluate Node.js module source from a string, buffer, or VM script — the same way require() works, without loading a file.

Uses Node's vm module instead of native eval().

Install

npm install array-inline

Usage

var arrayInline = require('array-inline')
var result = arrayInline(content /*, filename, scope, includeGlobals */)
ArgumentTypeDescription
contentString | Buffer | vm.ScriptSource to evaluate
filenameStringOptional name used in stack traces
scopeObjectVariables provided to the source
includeGlobalsBooleanExpose Node globals and require (default false)

Examples

var arrayInline = require('array-inline')

var res = arrayInline('var x = 123; exports.x = x')
// => res === { x: 123 }

res = arrayInline('module.exports = function () { return 123 }')
// => res() === 123

res = arrayInline('module.exports = require("events")', true)
// => res === require('events')

res = arrayInline('exports.x = process', true)
// => res.x === process

License

MIT. Based on node-eval.

Keywords

require

FAQs

Package last updated on 13 Sep 2026

Related posts