JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5107113
  • Score
    100M100P100Q206405F
  • License MIT

Request that Node.js child processes preload modules

Package Exports

  • node-preload

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-preload) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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