Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
babel-plugin-lodash
Advanced tools
Readme
A simple transform to cherry-pick Lodash modules so you don’t have to.
Combine with lodash-webpack-plugin for even smaller cherry-picked builds!
$ npm i --save lodash
$ npm i --save-dev babel-plugin-lodash babel-cli babel-preset-env
Transforms
import _ from 'lodash'
import { add } from 'lodash/fp'
const addOne = add(1)
_.map([1, 2, 3], addOne)
roughly to
import _add from 'lodash/fp/add'
import _map from 'lodash/map'
const addOne = _add(1)
_map([1, 2, 3], addOne)
{
"plugins": ["lodash"],
"presets": ["es2015"]
}
Set plugin options using an array of [pluginName, optionsObject]
.
{
"plugins": [["lodash", { "id": "lodash-compat", "cwd": "some/path" }]],
"presets": [["env", { "targets": { "node": 4 } }]]
}
The options.id
can be an array of ids.
{
"plugins": [["lodash", { "id": ["async", "lodash-bound"] }]],
"presets": [["env", { "targets": { "node": 4 } }]]
}
$ babel --plugins lodash --presets es2015 script.js
require('babel-core').transform('code', {
'plugins': ['lodash'],
'presets': [['env', { 'targets': { 'node': 4 } }]]
})
'module': {
'loaders': [{
'loader': 'babel-loader',
'test': /\.js$/,
'exclude': /node_modules/,
'query': {
'plugins': ['lodash'],
'presets': [['env', { 'targets': { 'node': 4 } }]]
}
}]
}
Can this plugin produce ES2015 imports rather than CommonJS imports?
This plugin produces ES2015 imports by default. The
transform-es2015-modules-commonjs
plugin, which is included in the Babel es2015
preset, transforms ES2015 import
statements to CommonJS. Omit it from your
preset to preserve ES2015 style imports.
FAQs
Modular Lodash builds without the hassle.
The npm package babel-plugin-lodash receives a total of 422,075 weekly downloads. As such, babel-plugin-lodash popularity was classified as popular.
We found that babel-plugin-lodash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.