package-docs

0.0.2 • Public • Published

Package Docs

Get packages' document homepages from package.json

Install

$ npm i -g package-docs

Usage

$ package-docs

It will read package.json and get packages in the dependencies/devDependencies/peerDependencies fields and save their document homepage urls into package-docs.json.

// pacakge.json
{
  "name": "package-docs",
  "dependencies": {
    "axios": "^0.18.0",
    "chalk": "^2.4.1",
    "lodash": "^4.17.10",
    "minimist": "^1.2.0",
    "prettyjson": "^1.2.1"
  },
  "devDependencies": {
    "eslint": "^5.4.0",
    "eslint-config-standard": "^11.0.0"
  }
}

output:

dependencies:
  axios:      https://github.com/axios/axios
  chalk:      https://github.com/chalk/chalk#readme
  lodash:     https://lodash.com/
  minimist:   https://github.com/substack/minimist
  prettyjson: http://rafeca.com/prettyjson
devDependencies:
  eslint:                 https://eslint.org
  eslint-config-standard: https://standardjs.com

Output to file

You may also save the output to json file by specifying the option -o, the output will save to package-docs.json by default

$ package-docs -o

Inline query

$ package-docs vue vuex
vue:  http://vuejs.org
vuex: https://vuex.vuejs.org

Open in browser

$ package-docs vue --open

--open option will make a prompt to confirm when opening more than 5 urls. You can specify -y to bypass the prompt.

TODO

  • Open in browser
  • Better error handling
  • Querying indicator
  • Publish to npm
  • Unit tests
  • Rewrite use class
  • Node.js API
  • Cache

License

MIT @antfu 2018

Package Sidebar

Install

npm i package-docs

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

12.6 kB

Total Files

8

Last publish

Collaborators

  • antfu