
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
werkzeug-packer
Advanced tools
Packs commonjs modules to browser ready bundles.
It is limited in its skills but easy to use and fast.
What werkzeug-packer does:
packs your commonjs style modules to bundles for use in browsers
supports asynchronous chunks (webpack style promisses)
watches for changes and packs incremental
merges source maps for all files into one for each bundle (with the ability to inline sources for use in firefox)
you can require json, css, html and txt files in your code, which will be inlined as strings (except json, which exports an object)
has little support for es6 node modules (es6 will be transpiled using babel)
experimental uglifying (leads to incorrect source mappings)
node core modules will be ignored
# for global commandline use:
npm install -g werkzeug-packer
# or local to your project:
npm install werkzeug-packer --save-dev
# if you have a file main.js, type:
wzp -p main.js
# this will create a bundle main.pack.js which includes all required files
# you also can specify the name and location for the resulting bundle
wzp -p main.js ./dist/main.bundle.js
# you can pack any number of modules:
wzp -p main.js -p vendor.js -p polyfills.js
# you have to add script tags for all packs
# to your index.html in the same order as specified
# add a -w flag to watch
wzp -p main.js -w
werkzeug-packer can be configured with the following flags:
-p --pack [file] [file?] Specify the input file and optional an output file.
If the output file is omitted, the input file's name is used.
with a 'pack' inserted before the extension:
e.g.: main.js -> main.pack.js
Can be used multiple times for each module to bundle.
-w --watch Start watching and repack on changes.
-bp --base-path [file] Specify a base path to resolve relative files used with -p flag.
-ub --use-babel Enable babel for es6 code.
-uu --use-uglify Enable experimantal uglify usage.
-im --inline-maps Include source code in source maps.
-em --external-maps Include soyrce maps from node modules.
-cp --chunk-prefix [path] Enter a path and/or a file prefix for all packed chunks.
The default is './js/chunk_'.
-lp --loader-prefix [string] Enter a string to prifix required path's for chunk loading.
The default is 'es6-promise!'.
-ne --node-env [string] Enter a value to set in window.process.env.NODE_ENV.
The default is 'development'.
-v --version Prints the version.
-h --help Prints this help.
If you specify more than the entry bundle, you have to require all other bundles from your main file (or from subsequent required files).
Otherwise they won't be activated.
Remember to place script tags for each bundle in your index.html.
# consider a file test.js
module.exports = Hello: 'World'
# then you can do the following in another file:
test = require 'es6-promise!./test'
test('Hello').then (result) ->
console.log 'Hello ' + result # prints 'Hello World' ;-)
# if the name is omitted the whole exports object is passed to result
werkzeug-packer is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.
FAQs
packs commonjs modules to browser ready bundles
The npm package werkzeug-packer receives a total of 7 weekly downloads. As such, werkzeug-packer popularity was classified as not popular.
We found that werkzeug-packer 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.