$ npm install parse-import-specifiers
Parse ImportSpecifiers
to 3 arrays
according to type.
There is 3
types of ImportSpecifiers
:
import test from 'supertape';
import * as test from 'supertape';
import {stub} from 'supertape';
So:
ImportDefaultSpecifier
can be at the placce of an array.npm i parse-import-specifiers
const {parseImportSpecifiers} = require('parse-imports-specifiers');
const {
defaults,
namespaces,
imports,
} = parseImportSpecifiers(specifiers);
for (const spec of defaults) {}
for (const spec of namespaces) {}
for (const spec of imports) {}
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE