Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Write ES2015 for the browser, import Node packages with the ES2015 module syntax and generate separate source maps.
Write ES2015 for the browser, import Node packages with the ES2015 module syntax and generate separate source maps.
esnow
is a Node package that preconfigures Browserify including the Babelify and Uglifyify transforms. It generates
separate source map files using Exorcist.
For watching and compiling changed files esnow uses watchify
. Watchify increases compile speed after the first compile because it uses caching.
It is very easy to use.
Install esnow
with npm.
npm install esnow --save-dev
Add an esnow
call it to your package.json scripts
field. Specify your entryfile with the -e
option and the output folder with the -o
option. esnow
will produce an main.js
and an main.js.map
in your output folder.
"scripts": {
"js": "esnow -e js/main.js -o out/js"
}
If you want to use Watchify just add -w
.
"scripts": {
"jsw": "esnow -e js/main.js -o out/js -w"
}
Execute it with npm.
npm run js
or
npm run jsw
Because we are using Browserify you can install and use node packages in your program of course.
Install a package as a devDependency:
npm install --save-dev some-cool-package
Then go ahead and import it in your program with the ES2015 module syntax:
import someCoolPackage from 'some-cool-package';
Then use it!
someCoolPackage();
The Babelify transform transpiles this to a CommonJS require
statement and passes it on to Browserify to bundle it up with your program.
You can also install and use it globally.
npm install -g esnow
Then just use it anywhere you want with the esnow
command.
esnow -e js/main.js -o out/js
or
esnow -e js/main.js -o out/js -w
Enjoy writing ESXXXX code with Node packages and debugging it easily via source maps.
--outputPath, -o Pass the output path (required).
--entryFile, -e Path to the entry file (required).
--watch, -w Watch and compile your files with watchify.
--prod, -p Production mode (minifies the code).
--outputFileName, -f Name of the output file defaults to the basename of `--entryFile`.
commander
package.json
for Browserify transformsMIT © Kahlil Lechelt
FAQs
Write ES2015 for the browser, import Node packages with the ES2015 module syntax and generate separate source maps.
We found that esnow 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.