Dependency table

March 26, 2022 ยท View on GitHub

Add a table of dependencies to markdown files via markdown-magic

Install

npm i markdown-magic markdown-magic-dependency-table --save-dev

Adding the plugin

See example.js for usage.

const fs = require('fs');
const path = require('path');
const markdownMagic = require('markdown-magic');

const config = {
  transforms: {
    DEPENDENCYTABLE: require('./index.js'),
  },
};

const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);

Usage in markdown

DependencyDescriptionVersionLicenseType
find-up@^2.1.0Find a file by walking up parent directories2.1.0MITproduction
semver@^5.3.0The semantic version parser used by npm.5.7.1ISCproduction
markdown-magic@>=0.1 <...Automatically update markdown files with content from external sources2.6.0MITpeer
prettier@^2.0.0Prettier is an opinionated code formatter2.6.1MITpeer
markdown-magic@>=0.1 <...Automatically update markdown files with content from external sources2.6.0MITdev
prettier@^2.0.0Prettier is an opinionated code formatter2.6.1MITdev

Options

  • production (false) - include production dependencies
  • dev (false) - include development dependencies
  • optional (false) - include optional dependencies
  • peer (false) - include peer dependencies