
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
es6-esm-boilerplate
Advanced tools
Build ES modules from ES6 source code with Webpack.
Starting with this boilerplate, we can develop simple-to-complex ES Modules targeting the latest browsers, development with Babel, and Node runtime. At the same time, the ES5-compatible build is also generated.
es6-esm-boilerplate
├── package.json
├── webpack.config.js
├── src # ES6 source code
│ ├── Base.js # class
│ ├── Foo.js # subclass of Base
│ ├── Bar.js # subclass of Base
│ ├── index.js # module implementation (export { Foo, Bar })
│
├── lib # ES module output
│ ├── my-module.js # esm
│ ├── my-module.min.js # esm minified
│ ├── my-module.compat.js # esm with ES5-compatibility
│ ├── my-module.compat.min.js # esm with ES5-compatibility minified
ES6 source code -> var-module -> my-module.js (export default MyModule;)
{Base,Foo,Bar,index}.js (var MyModule = ...;) -> my-module.compat.js (UMD)
First, bundle ES6 source code into a var-module. Then, export the
var-module using the ES Module's export
syntax to finally get
my-module.js
. This module file can be directly consumed on relatively
new
browsers.
we also build my-module.compat.js
for compatibility with older
browsers, development with Babel, and NodeJS. This module file conforms
to the UMD patterns that provide the
script-tag loading, Node-require, and AMD compatibilities.
All the "var-to-esm transformation" is performed by a tiny Webpack plugin called webpack-var2esm-plugin.
$ npm install # set up build tools
$ npm run build # get ES module output in lib/ by Babel
FAQs
Build ES modules from ES6 source code
The npm package es6-esm-boilerplate receives a total of 4 weekly downloads. As such, es6-esm-boilerplate popularity was classified as not popular.
We found that es6-esm-boilerplate 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.