Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
real-require
Advanced tools
Keep require and import consistent after bundling or transpiling.
Just run:
npm install real-require
The package provides two drop-ins functions, realRequire
and realImport
, which can be used in scenarios where tools like transpilers or bundlers change the native require
or await import
calls.
The current realRequire
functions only handles webpack at the moment, wrapping the __non_webpack__require__
implementation that webpack provides for the final bundle.
// After bundling, real-require will be embedded in the bundle
const { realImport, realRequire } = require('real-require')
/*
By using realRequire, at build time the module will not be embedded and at runtime it will try to load path from the local filesytem.
This is useful in situations where the build tool does not support skipping modules to embed.
*/
const { join } = realRequire('path')
async function main() {
// Similarly, this make sure the import call is not modified by the build tools
const localFunction = await realImport('./source.js')
localFunction()
}
main().catch(console.error)
See CONTRIBUTING.md
Copyright Paolo Insogna and real-require contributors 2021. Licensed under the MIT License.
FAQs
Keep require and import consistent after bundling or transpiling
The npm package real-require receives a total of 5,466,313 weekly downloads. As such, real-require popularity was classified as popular.
We found that real-require demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.