showdeps

1.0.0 • Public • Published

showdeps

A little library to list all dependencies from code.

Install

npm install --save showdeps

Usage

import showdeps from 'showdeps'
 
const code = `
  import strman from 'strman'
 
  console.log('dleitee')
`
 
showdeps(code)
 
/**
 * [{
 *   "file": "strman",
 *   "specifiers": [{
 *     "name": "strman",
 *     "type": "ImportDefaultSpecifier",
 *   }],
 * }]
 */

Specifiers types

ImportDefaultSpecifier

When you import default dependency. Ex. import strman from 'strman'

ImportSpecifier

When you import specified dependency. Ex. import { replace } from 'strman'

ImportNamespaceSpecifier

When you import named dependency. Ex. import * as strman from 'strman'

Readme

Keywords

none

Package Sidebar

Install

npm i showdeps

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dleitee