
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
build-modules
Advanced tools
build-modules
Easily build a umd package from a project of CommonJS (node.js style) modules that can be loaded via require.js or as a traditional browser global loaded in a <script> tag. Has an option to "watch" the source files and rebuild the package on the fly.
This uses webpack under the hood.
npm install build-modules
var build = require('build-modules')
var emitter = build(__dirname+'/rootDirectory/moduleName', {output:{path: __dirname+'/generatedFile/'}})
emitter.on('done', function() {
console.log("Done!")
})
emitter.on('error', function(e) {
console.log(e)
})
emitter.on('warning', function(w) {
console.log(w)
})
build-modules
over Browserify and Webpack?If you just want to easily support people using require.js and traditional script inclusion, but don't need anything complicated, this module is for you. It also exposes the "watcher" ability from webpack (which browserify doesn't have).
build(filepath, options)
filepath
- The absolute path to the module file.options
- An object with optional parameters. Can contain the following members:
watch
- If true, sets up a watcher that rebuilds the bundle whenever relevant source files change (keeps running until the process closes)name
- The name of the global variable in the case the UMD package is loaded without a module system (defaults to path.basename(filepath)
)header
- A string to put at the top of the build bundle.output
- An object with the members:
path
- Where to put the bundle file (defaults to the entrypoint directory)name
- What to name the output bundle (defaults to options.name+'.umd.js')alias
- Webpack alias option.plugins
- Additional webpack plugins to add.jsonpFunction
- The name of the jsonp function name (defaults to webpack's default).minify
- If false, this doesn't minify and also adds pathinfo to modules in the bundle. Default: true.sourceMap
- (Default:true) If false, won't produce a source map. If true, will use the 'source-map' webpack devtool option. If something else, it'll set the webpack devtool option to that value.Outputs the following files:
When build is called with the watch option, 'done' is emitted twice in a row on the first run. After that, you just get the expected 1 per build.
sourceMap
optionReleased under the MIT license: http://opensource.org/licenses/MIT
FAQs
`build-modules` ============
We found that build-modules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.