Package Exports
- import-holmes
- import-holmes/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (import-holmes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Import Holmes is a tool to inspect Javascript/Typescript projects imports
Warning this tool isn't in a stable version, check issues page to check futures features and current problems
Getting Started
Installing
# recommended
npx import-holmes
# or
pnpm add -g import-holmes
# or
yarn global add import-holmes
# or
npm add --location=global import-holmes
Warning if your intention is to use the core functions in your project consider not using global install
Cli
import-holmes
# or
import-holmes inspect
Core
This package also provides the core function under the cli.
inspectModule
inspects a typescript/javascript module searching for import declarations and returns results from imports
import { inspectModule } from 'import-holmes'
const someCode = `\
import a from 'b'
import { c } from 'd'
import { e as f } from 'g'
`
const inspect = inspectModule(someCode)
// outputs
[
{ specifier: 'a', moduleName: 'b' },
{ specifier: 'c', moduleName: 'd' },
{ specifier: 'e', moduleName: 'g' }
]
There are some available options in inspect module
inspectModule('source code', {
modulesFilter?: string | string[]
specifiersFilter?: string | string[]
})
Made with ❤️ by Peam