Git Product home page Git Product logo

package-json-to-readme's Introduction

package-json-to-readme Build Status

Generate a README.md from package.json contents. Works with node and io.js.

Why?

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 package.json file: name, description, scripts.test, preferGlobal, etc. That's why package-json-to-readme exists. Use it to generate a decent boilerplate README, then iterate from there.

Installation

npm i -g package-json-to-readme

Usage

# Write to stdout
readme package.json

# Pipe output into a new file
readme package.json > README.md

# Add a Travis badge
readme package.json --travis

# Run tests and add their output
readme package.json --tests

# Do it all
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.

Tests

npm install
npm test

Dependencies

  • 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.

Dev Dependencies

  • mocha: simple, flexible, fun test framework
  • nixt: Simple and powerful testing for command-line apps

License

MIT

See Also

  • readme-md-generator, a CLI that's able to read your environment (package.json, git config...) to suggest you default answers during the README creation process.
  • mos, a pluggable module that injects content into your markdown files via hidden JavaScript snippets.

package-json-to-readme's People

Contributors

bcoe avatar billiegoose avatar chrispearce avatar dawsbot avatar hemanth avatar readmecritic avatar timoxley avatar zeke avatar zerogiven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

package-json-to-readme's Issues

Similar to projectz

https://github.com/bevry/projectz has been around for a few years now and seems to already accomplish what this project aims to do. It is used on all bevry and docpad repos. Plan is to extend it with a plugin system in the coming months. Happy to improve it as necessary.

Package version in READMEmd

Hi...Is there a way to put the versions of each package in the generated README.md ?

Thank you for your answer.

Add custom readme

We need a way to show custom usage outside of the example.js file. For example showing css, or just adding additional comments. Is there a way to do this?

use `update-readme` to power version 3.x

@zeke: package-json-to-readme has served me well for the last few years, but I really need to dust it off and make some improvements. It's currently useful for getting a README started but after that you're on your own. I would love to borrow some of the concepts from mos and jsmd to help keep READMEs up to date over time.

I am in the same place. I have a README template I use in my project boilerplate, but whenever I make improvements, it only benefits new modules I write. There's not an easy way to update my existing projects to a new, improved README.

mos and projectz are both really cool - but both involve changing the way you write READMEs and adding extra markup in HTML comments. My boilerplate is a frankenstein of package-json-to-readme, mos, and projectz and it's ridiculous.

I've started a Github org called update-readme with the goal of updating README files without the constraint of requiring additional markup. I feel that having the tool work with existing README files as they are found in the wild is important to frictionless adoption. I'm using a very different approach than the hogan template rendering that package-json-to-readme uses, but would love to see package-json-to-readme v3.x implemented as a collection of update-readme plugins. (Disclaimer: I'm not satisfied with the plugin authoring API. As it stands, I think it exposes too much implementation detail. But since I'm implementing it, that's actually convenient.) Right now it only has two plugins, one for name & description and one for license. Both of which I wrote yesterday.

Thoughts? Feedback? Hopes? Fears? Dreams?

Charset

Can I generate a UTF-8 readme?

(the generated markdown is UTF-16 LE)

Generated Readme rendered by npmjs repository
image

btw in Github
image

Why?

I found the link to this repo on HN. I kinda miss the reason "why" someone would need to create README from Package.json and what kind of value does this add to the project if all info can be found in the package.json file?

Also I'm wondering if the main README file of this very repo is generated using itself?

I think the README (no pun intended) could elaborate.

Add different badges

Hi there,

it would be great if you could add multiple badges based on cli arguments. shields.io might be a useful resource as the urls are standardized for all badges.
If you are interested I could create a pull request.

Best,
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.