sr
v1.0.4
Published
Unblock your event loop! Require modules in a child process effortlessly
Downloads
89
Maintainers
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
withsr
- 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