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
requirewithsr - Only function calls are proxied
Install
npm i srUse
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