showdeps
A little library to list all dependencies from code.
Last updated 3 years ago by dleitee .
MIT · Original npm · Tarball · package.json
$ cnpm install showdeps 
SYNC missed versions from official npm registry.

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'

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

1 Versions

  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 7
Dependencies (2)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |