Gathering detailed insights and metrics for @xymopen/babel-plugin-auto-import
Gathering detailed insights and metrics for @xymopen/babel-plugin-auto-import
Gathering detailed insights and metrics for @xymopen/babel-plugin-auto-import
Gathering detailed insights and metrics for @xymopen/babel-plugin-auto-import
Convert global variables to import statements
npm install @xymopen/babel-plugin-auto-import
Typescript
Module System
Min. Node Version
Node Version
NPM Version
60.6
Supply Chain
97.8
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
BSD-3-Clause License
41 Commits
1 Watchers
8 Branches
5 Contributors
Updated on Oct 15, 2024
Latest Version
1.1.0
Package Id
@xymopen/babel-plugin-auto-import@1.1.0
Unpacked Size
14.37 kB
Size
4.08 kB
File Count
4
NPM Version
6.14.5
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Convert global variables to import statements
This is an replacement for babel-plugin-auto-import but in another configuration style.
This plugin fails test should insert import for object property
where it transforms...
1let a = { 2 b: x, 3 y, 4 z: c 5}
...into...
1-import { x } from "some-path" 2+import { x, y } from "some-path" 3 4 let a = { 5 b: x, 6 y, 7 z: c 8 }
...which I believe is expected.
1{ 2 plugins: [ 3 [ 4 '@xymopen/babel-plugin-auto-import', 5 /** @type {import('@xymopen/babel-plugin-auto-import').BabelAutoImportPluginOption} */ 6 ({ 7 Vue: { from: 'vue', default: true } 8 }) 9 ] 10 ] 11}
...will transform...
1Vue.component('my-component', { /* ... */ })
...into...
1import Vue from 'vue' 2 3Vue.component('my-component', { /* ... */ })
1{ 2 plugins: [ 3 [ 4 '@xymopen/babel-plugin-auto-import', 5 /** @type {import('@xymopen/babel-plugin-auto-import').BabelAutoImportPluginOption} */ 6 ({ 7 // You can defer the configuration generation 8 factory(babel, program, state) { 9 return { 10 Vue: { from: 'vue-class-component' }, 11 Component: { from: 'vue-class-component', default: true } 12 } 13 } 14 }) 15 ] 16 ] 17}
...will transform...
1@Component 2class MyComponent extends Vue { }
...into...
1import Component, { Vue } from 'vue-class-component' 2 3@Component 4class MyComponent extends Vue { }
Suitable for injecting peer dependency.
1{ 2 plugins: [ 3 [ 4 '@xymopen/babel-plugin-auto-import', 5 /** @type {import('@xymopen/babel-plugin-auto-import').BabelAutoImportPluginOption} */ 6 ({ 7 Vue: { from: 'vue-property-decorator' }, 8 Component: { from: 'vue-property-decorator' }, 9 Prop: [ 10 { from: 'reflect-metadata', sideEffect: true }, 11 { from: 'vue-property-decorator' } 12 ] 13 }) 14 ] 15 ] 16}
...will transform...
1@Component 2class MyComponent extends Vue { 3 @Prop() age 4}
...into...
1import 'reflect-metadata' 2import { Component, Vue, Prop } from 'vue-property-decorator' 3 4@Component 5class MyComponent extends Vue { 6 @Prop() age 7}
WARNING: The plugin doesn't check if the import is sideEffect
and misconfiguration could result in conflict or be tree shaked.
Suitable for polyfilling browser built-ins (eg. window.fetch
).
1{ 2 plugins: [ 3 [ 4 '@xymopen/babel-plugin-auto-import', 5 /** @type {import('@xymopen/babel-plugin-auto-import').BabelAutoImportPluginOption} */ 6 ({ 7 fetch: { from: 'whatwg-fetch', sideEffect: true } 8 }) 9 ] 10 ] 11}
...will transform...
1fetch('http://example.com/qwe')
...into...
1import 'whatwg-fetch' 2 3fetch('http://example.com/qwe')
1{ 2 plugins: [ 3 [ 4 '@xymopen/babel-plugin-auto-import', 5 /** @type {import('@xymopen/babel-plugin-auto-import').BabelAutoImportPluginOption} */ 6 ({ 7 styles (babel, program, state) { 8 return { 9 from: `./${path.relative(state.cwd, state.filename).replace(/\.js$/, '.css')}`, 10 default: true 11 } 12 } 13 }) 14 ] 15 ] 16}
...will transform component-name.js
...
1// ... 2<input className={styles.className} /> 3// ...
...into...
1import styles from './component-name.css'; 2// ... 3<input className={styles.className} /> 4// ...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
29 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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