unified

Project:unlight/remark-package-dependencies

Package:remark-package-dependencies@1.1.0

  1. Dependencies:4·Dependents:0
  2. Inject to markdown the list of dependencies of your package
  1. remark 165
  2. markdown 82
  3. remark-plugin 20

remark-package-dependencies

Inject to markdown the list of dependencies of your package

Install

npm install --save-dev remark-package-dependencies

Usage

const remark = require('remark');
const remarkPackageDependencies = require('remark-package-dependencies');
const input = '## Dependencies';
const output = remark()
    .use(remarkPackageDependencies, options)
    .processSync(input)
    .toString();

Output:

## Dependencies

| Name              | Description                                       | Version |   Size | License |
| :---------------- | :------------------------------------------------ | :------ | -----: | :-----: |
| bundle-phobia-cli | Cli for the node BundlePhobia Service             | 0.14.1  | 151.7k |   MIT   |
| prettysize        | Convert bytes to other sizes for prettier logging | 2.0.0   |   592B |   BSD   |
| unist-util-visit  | Recursively walk over unist nodes                 | 2.0.0   |   1.6k |   MIT   |

Options

const defaultOptions = {
    /**
     * Content will be inserted after heading with this text value
     */
    heading: 'Dependencies',
    /**
     * Path to `package.json`
     */
    packagePath: 'package.json',
};