Gathering detailed insights and metrics for babel-plugin-transform-rename-import
Gathering detailed insights and metrics for babel-plugin-transform-rename-import
rename imports and requires
npm install babel-plugin-transform-rename-import
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
15,305,583
Last Day
11,135
Last Week
52,098
Last Month
260,983
Last Year
3,525,676
45 Stars
61 Commits
6 Forks
3 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
2.3.0
Package Id
babel-plugin-transform-rename-import@2.3.0
Size
2.49 kB
NPM Version
5.6.0
Node Version
9.11.1
Publised On
01 Jul 2018
Cumulative downloads
Total Downloads
Last day
-12.7%
11,135
Compared to previous day
Last week
-20.5%
52,098
Compared to previous week
Last month
5%
260,983
Compared to previous month
Last year
2.2%
3,525,676
Compared to previous year
replace import sources
$ npm install --save babel-plugin-transform-rename-import
1{ 2 "plugins": [["transform-rename-import", { original: 'assert', replacement: 'power-assert' }]] 3}
or multiple replacements:
1{ 2 "plugins": [ 3 ["transform-rename-import", { 4 replacements: [ 5 { original: 'replace-me', replacement: 'replaced' }, 6 { original: 'replace-me2', replacement: 'replaced2' } 7 ] 8 } 9 ]] 10}
RegExp:
1{ 2 "plugins": [["transform-rename-import", { original: '^(.+?)\\.less$', replacement: '$1.css' }]] 3}
1import plugin from 'babel-plugin-transform-rename-import' 2import { transform } from 'babel-core' 3 4function replace (code, original, replacement) { 5 return transform(code, { 6 babelrc: false, 7 plugins: [ 8 [plugin, { original, replacement} ], 9 ], 10 }).code; 11} 12 13replace("require('foo')", 'foo', 'bar') 14//=> "require('bar');" 15 16replace("import foo from 'foo'", 'foo', 'bar') 17//=> "import foo from 'bar';" 18 19replace("require('foo/thingy')", 'foo', 'bar') 20//=> "require('bar/thingy');" 21 22replace("require('foo/thingy.less')", '^(.+?)\\.less$', '$1.css') 23//=> "require('foo/thingy.css');"
MIT © Sigurd Fosseng
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/27 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More