Generate a README.md from package.json contents. Works with node and io.js.
Every project worth its salt has a README that answers (at least) the following questions:
- What's it called?
- What is it for?
- How do I install it?
- How do I use it?
- How do I test it?
- What is the license?
With npm modules, most of that info can be gleaned from properties in the
preferGlobal, etc. That's why
pkg-2-readme exists. Use it to generate a decent boilerplate README, then iterate from there.
npm i -g pkg-2-readme
# Write to stdoutpkg-2-readme package.json# Pipe output into a new filepkg-2-readme package.json > README.md# Add a Travis badgepkg-2-readme package.json --travis# Run tests and add their outputpkg-2-readme package.json --tests# Do it allpkg-2-readme package.json --tests --travis > README.md# If your package has an example.sh or example.js file, it will be used to# generate a usage section like this one.# If your example.js has a require("./") statement, the relative path will be# replaced with the package name.
npm installnpm test
- github-url-to-object: Extract user, repo, and other interesting properties from GitHub URLs
- hogan.js: A mustache compiler.
- strip-ansi: Strip ANSI escape codes
- sync-exec: Synchronous exec with status code support. Requires no external dependencies, no need for node-gyp compilations etc.
- yargs: Light-weight option parsing with an argv hash. No optstrings attached.