JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q45105F
  • License GPL

Unblock your event loop! Require modules in a child process effortlessly

Package Exports

  • sr

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 (sr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Super Require

Unblock your event loop! Require modules in a child process effortlessly

Features:

  • Works with callbacks, promises and async/await
  • Easiest adoption: Just replace require with sr
  • Only function calls are proxied

Install

npm i sr

Use

Replace require with sr

Before

const request = require('request')

After:

const sr = require('sr')
const request = sr('request')

Note: To use with localmodules, use path.resolve

Before:

const module = require('./module')

After:

const path = require('path')
const sr = require('sr')

const module = sr(path.resolve(__dirname, './module'))

License

MIT © Diego Rodríguez Baquero - 2019