Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
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 668 weekly downloads. As such, babel-plugin-import-rename popularity was classified as not 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.