Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
simplifyify
A simplified Browserify and Watchify CLI
sourcemapify
Sourcemap plugin for Browserify
browserify-banner
Add a comment (and/or code) to the top of your Browserify bundle
Install using npm. Add the -g
flag to install globally so you can use it from any terminal.
npm install -g @jsdevtools/globify
The command-line interface is identical to browserify and watchify. In fact, globify simply passes your arguments straight to browserify or watchify (after expanding the glob pattern).
globify <entry files glob> [options]
Options:
<entry files glob>
Glob pattern of entry files. Don't forget to wrap the glob pattern in quotes,
otherwise some shells (like bash) will pre-expand the glob.
--outfile=FILE, -o FILE
If outfile is a file, then a single bundle will be created. If it's a directory,
then separate bundles will be created for each entry file. You can also specify
an output filename pattern, like *.bundled.js
--exclude=GLOB, -u GLOB
Excludes files that are matched by the <entry files glob>
--watch, -w
Call watchify instead of browserify.
For all of these examples, assume that we have a file structure like this:
lib/
|__ my-entry-file.js
|__ some-file.js
|__ other-file.js
|__ other-entry-file.js
|__ subdir/
|__ another-entry-file.js
|__ another-file.js
|__ yet-another-file.js
We want to bundle all three entry files into a single bundle file. We can do that with the following command:
globify "lib/**/*-entry-file.js" --outfile=dist/my-bundle.js
Globify will call browserify
once, passing it the three matching entry files and one bundle file:
browserify lib/my-entry-file.js lib/other-entry-file.js lib/subdir/another-entry-file.js --outfile=dist/my-bundle.js
We want to create separate bundle files for each of the three entry files. We can do that with the following command:
globify "lib/**/*-entry-file.js" --outfile=dist
Globify will call browserify
three times (once for each entry file), and create three corresponding bundles:
browserify lib/my-entry-file.js --outfile=dist/my-entry-file.js
browserify lib/other-entry-file.js --outfile=dist/other-entry-file.js
browserify lib/subdir/another-entry-file.js --outfile=dist/subdir/another-entry-file.js
We want to create separate bundle files for each of the three entry files, but we weant each bundle file to have a .bundled.js
suffix. We can do that with the following command:
globify "lib/**/*-entry-file.js" -o "dist/*.bundled.js"
Globify will call browserify
three times (once for each entry file) and create three corresponding bundles:
browserify lib/my-entry-file.js -o dist/my-entry-file.bundled.js
browserify lib/other-entry-file.js -o dist/other-entry-file.bundled.js
browserify lib/subdir/another-entry-file.js -o dist/subdir/another-entry-file.bundled.js
Now, let's try it with watchify instead. Let's also add some extra options, and run the uglifyify
transforms to minify the bundles. And let's give the bundles a .bundled.min.js
suffix.
globify -g uglifyify "lib/**/*-entry-file.js" -w -v -d -o "dist/*.bundled.min.js"
Globify will call watchify
(because of the -w
option) three times with all of the specified options:
watchify -g uglifyify lib/my-entry-file.js -v -d -o dist/my-entry-file.bundled.min.js
watchify -g uglifyify lib/other-entry-file.js -v -d -o dist/other-entry-file.bundled.min.js
watchify -g uglifyify lib/subdir/another-entry-file.js -v -d -o dist/subdir/another-entry-file.bundled.min.js
Contributions, enhancements, and bug-fixes are welcome! Open an issue on GitHub and submit a pull request.
To build/test the project locally on your computer:
Clone this repo
git clone https://github.com/JS-DevTools/globify.git
Install dependencies
npm install
Run the tests
npm test
Globify is 100% free and open-source, under the MIT license. Use it however you want.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
Thanks to these awesome companies for their support of Open Source developers ❤
FAQs
Run browserify and watchify with globs - even on Windows!
We found that globify 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.