https://github.com/unlight/remark-package-dependencies
Inject to markdown the list of dependencies of your package
https://github.com/unlight/remark-package-dependencies
dependencies markdown remark remark-plugin
Last synced: about 1 year ago
JSON representation
Inject to markdown the list of dependencies of your package
- Host: GitHub
- URL: https://github.com/unlight/remark-package-dependencies
- Owner: unlight
- License: mit
- Created: 2019-10-26T20:20:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T17:56:21.000Z (about 5 years ago)
- Last Synced: 2024-09-23T01:47:53.919Z (over 1 year ago)
- Topics: dependencies, markdown, remark, remark-plugin
- Language: JavaScript
- Size: 26.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# remark-package-dependencies
Inject to markdown the list of dependencies of your package
## Install
```sh
npm install --save-dev remark-package-dependencies
```
## Usage
```js
const remark = require('remark');
const gfm = require('remark-gfm');
const remarkPackageDependencies = require('remark-package-dependencies');
const input = '## Dependencies';
const output = remark()
.use(gfm)
.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
```js
const defaultOptions = {
/**
* Content will be inserted after heading with this text value
*/
heading: 'Dependencies',
/**
* Path to `package.json`
*/
packagePath: 'package.json',
};
```