Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
A dead-simple tool to add import
/ export
ES Module syntax to your browserify builds.
The plugin makes the following changes to your bundler:
.mjs
extension to module resolution (which take precedence over .js
files)"module"
field in package.json
when a "browser"
field is not specifiedimport
/ export
statements) into CommonJSUse it with the --plugin
or -p
flags in browserify:
browserify index.js -p esmify > bundle.js
Also works with budo and similar tools, for example:
budo index.js --live -- -p esmify
Files that don't contain import
/ export
syntax are ignored, as are dynamic import expressions. The plugin runs across your bundle (including node_modules
) in order to support ESM-authored modules on npm.
Use npm to install.
npm install esmify --save-dev
Also can be used via API like so:
browserify({
plugin: [
[ require('esmify'), { /* ... options ... */ } ]
]
});
plugin = esmify(bundler, opt = {})
Returns a browswerify plugin function that operates on bundler
with the given options:
mainFields
which describes the order of importance of fields in package.json resolution, defaults to [ 'browser', 'module', 'main' ]
plainImports
(Experimental) this feature will map named imports directly to their CommonJS counterparts, without going through Babel's inter-op functions. This is generally needed for static analysis of fs
, path
and other tools like glslify
in browserify. Defaults to [ 'fs', 'path', 'glslify' ]
.Under the hood, this uses Babel and plugin-transform-modules-commonjs
to provide robust inter-op that handles a variety of use cases.
MIT, see LICENSE.md for details.
FAQs
parse and handle import/export for browserify
The npm package esmify receives a total of 16,357 weekly downloads. As such, esmify popularity was classified as popular.
We found that esmify 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.