npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hitorisensei/markdown-readme-generator

v1.0.2

Published

Fills template blocks within your markdown readme files. With monorepo packages support build-in.

Downloads

27

Readme

@hitorisensei/markdown-readme-generator

Fills template blocks within your markdown readme files. With monorepo packages support build-in.

Usage

Use

<!-- {blockname} --><!-- {blockname} end -->

within your markdown file.

After processing, contents between those comment blocks will be filled.

Look at this README.md source for comparison.

Block supplied by default:

  • Fields extracted from package.json:
<!-- title -->
# @hitorisensei/markdown-readme-generator
<!-- title end -->
<!-- description -->
Fills template blocks within your markdown readme files. With monorepo packages support build-in.<!-- description end -->
  • Deep package.json fields and inline rendering
`yargs` dependency version: **<!-- dependencies.yargs -->^17.0.1<!-- dependencies.yargs end -->** !

gives:

yargs dependency version: ^17.0.1 !

...etc

  • List of monorepo packages (check --packages CLI option)
<!-- packages -->
## example


`example-monorepo-package`


A monorepo package example
<!-- packages end -->
  • Links to packages
<!-- link example -->
[example](#example)
<!-- link example end -->
  • [Custom block definitions](#Custom block definitions)

CLI Options

Options:
      --version              Show version number                       [boolean]
  -o, --outFile              output file path. Can be relative to project root
                             or absolute       [required] [default: "README.md"]
  -i, --inFile               input/template file path. Can be relative to
                             project root or absolute. If inFile is used,
                             outFile will not contain template comment tags,
                             unless keepTags option is set.
                                                          [default: "README.md"]
      --packages             packages directory location  [default: "packages/"]
      --keepTags             keep template tags even if inFile is used.
                                                      [boolean] [default: false]
      --project              root project location
      --dry                  do not write output file, print results to stdout
                             instead                                   [boolean]
      --skipGeneratedHeader  Do not add "DO NOT EDIT THIS FILE" header to output
                             files when template file is used
                                                      [boolean] [default: false]
  -r, --recursive            should also update readme files in packages
                                                                 [default: true]
      --create               create readme file if one does not exist yet
                                                                 [default: true]
  -v, --verbose              display verbose output   [boolean] [default: false]
      --custom               load custom block definitions from file (js or
                             json)
      --help                 Show help                                 [boolean]

Custom block definitions

You can describe your own replacement blocksCustom with either .json file or .js module

JS

const { execSync } = require('child_process');
const usageContent = execSync('node . --help').toString();

module.exports = {
  // you can use https://www.npmjs.com/package/json2md notation
  asJsonMD: [
    {
      code: {
        language: 'bash',
        content: [usageContent],
      },
    },
  ],

  // or literal markdown
  asLiteralMd: `
    \`\`\`bash
    ${usageContent}
    \`\`\`
  `,
};

JSON

{
  "asJsonMD": [
    {
      "code": {
        "language": "bash",
        "content": [
          "Options:\n      --version              Show version number                       [boolean]\n  -o, --outFile              output file path. Can be relative to project root\n                             or absolute       [required] [default: \"README.md\"]\n  -i, --inFile               input/template file path. Can be relative to\n                             project root or absolute. If inFile is used,\n                             outFile will not contain template comment tags,\n                             unless keepTags option is set.\n                                                          [default: \"README.md\"]\n      --packages             packages directory location  [default: \"packages/\"]\n      --keepTags             keep template tags even if inFile is used.\n                                                      [boolean] [default: false]\n      --project              root project location\n      --dry                  do not write output file, print results to stdout\n                             instead                                   [boolean]\n      --skipGeneratedHeader  Do not add \"DO NOT EDIT THIS FILE\" header to output\n                             files when template file is used\n                                                      [boolean] [default: false]\n  -r, --recursive            should also update readme files in packages\n                                                                 [default: true]\n      --create               create readme file if one does not exist yet\n                                                                 [default: true]\n  -v, --verbose              display verbose output   [boolean] [default: false]\n      --custom               load custom block definitions from file (js or\n                             json)\n      --help                 Show help                                 [boolean]\n"
        ]
      }
    }
  ],
  "asLiteralMd": "\n    ```bash\n    Options:\n      --version              Show version number                       [boolean]\n  -o, --outFile              output file path. Can be relative to project root\n                             or absolute       [required] [default: \"README.md\"]\n  -i, --inFile               input/template file path. Can be relative to\n                             project root or absolute. If inFile is used,\n                             outFile will not contain template comment tags,\n                             unless keepTags option is set.\n                                                          [default: \"README.md\"]\n      --packages             packages directory location  [default: \"packages/\"]\n      --keepTags             keep template tags even if inFile is used.\n                                                      [boolean] [default: false]\n      --project              root project location\n      --dry                  do not write output file, print results to stdout\n                             instead                                   [boolean]\n      --skipGeneratedHeader  Do not add \"DO NOT EDIT THIS FILE\" header to output\n                             files when template file is used\n                                                      [boolean] [default: false]\n  -r, --recursive            should also update readme files in packages\n                                                                 [default: true]\n      --create               create readme file if one does not exist yet\n                                                                 [default: true]\n  -v, --verbose              display verbose output   [boolean] [default: false]\n      --custom               load custom block definitions from file (js or\n                             json)\n      --help                 Show help                                 [boolean]\n\n    ```\n  "
}