Socket
Socket
Sign inDemoInstall

node-preload

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-preload

Request that Node.js child processes preload modules


Version published
Maintainers
1
Install size
12.0 kB
Created

Changelog

Source

0.1.4 (2019-11-01)

Features

Readme

Source

node-preload

Travis CI Greenkeeper badge NPM Version NPM Downloads MIT

Request that Node.js child processes preload modules

Install node-preload

This module requires node.js 8 or above.

npm i node-preload

Usage

'use strict';

const nodePreload = require('node-preload');

// Request that all Node.js child processes preload @babel/register
nodePreload.preloadAppend(require.resolve('@babel/register'));

// Request that child processes be spawned with enviroment TEST1=value1
nodePreload.propagateEnv.TEST1 = 'value1';

preloadAppend(filename)

Append filename to the list of modules to be preloaded. If filename is already in the list it will be moved to the end.

preloadInsert(filename)

Insert filename to the list of modules to be preloaded. If filename is already in the list it will be moved to the beginning.

preloadRemove(filename)

Remove filename from the list of modules to be preloaded.

preloadGetList()

Retrieve an array listing the current filenames to be preloaded.

propagateEnv

Similar to process.env but controls environmental variables to be propagated to child processes.

Running tests

Tests are provided by xo and ava.

npm install
npm test

FAQs

Last updated on 01 Nov 2019

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