Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
babel-plugin-import-rename
Advanced tools
Rename import sources with a RegExp like a boss.
Maybe you want to remove .jsx
extension from compiled files:
input.js
import Foo from './Foo.jsx'
.babelrc
{
"presets": ["react", "es2015"],
"plugins": [
["import-rename", {"^(.*)\\.jsx$": "$1"}]
]
}
output.js
'use strict';
var _Foo = require('./Foo');
var _Foo2 = _interopRequireDefault(_Foo);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
Specify sources and replacements as plugin options. Option keys are strings passed directly to the RegExp constructor for matching against import sources in your code. Option values are the replacements.
{
"plugins": [[
"import-rename", {
"regex1": "replacement1",
"regex2": "replacement2"
}
]]
}
require('babel-core').transform('code', {
plugins: [[
'import-rename', {
'regex1': 'replacement1',
'regex2': 'replacement2'
}
]]
})
FAQs
Rename import sources
The npm package babel-plugin-import-rename receives a total of 1,656 weekly downloads. As such, babel-plugin-import-rename popularity was classified as popular.
We found that babel-plugin-import-rename 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.