docs: add guide for writing readmes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
closes #3209
authored by Rand McKinney · committed by Douglas Christopher Wilson · parent f3a47e3 · Browse files · 1 file·+125 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+125 added−0 removed
- other:+125 added−0 removed
Provenance
- Commit
1678613- Tree
a601a8c- Author
Rand McKinney <crandmck@yahoo.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent
f3a47e3
1 file changed+125 added−0 removed
added:Readme-Guide.md+125 added
1+# README guidelines2+3+Every module in the expressjs, pillarjs, and jshttp organizations should have4+a README file named `README.md`. The purpose of the README is to:5+6+- Explain the purpose of the module and how to use it.7+- Act as a landing page (both on GitHub and npmjs.com) for the module to help8+ people find it via search. Middleware module READMEs are also incorporated9+ into https://expressjs.com/en/resources/middleware.html.10+- Encourage community contributions and participation.11+12+Use the [README template](https://github.com/expressjs/express/wiki/README-template)13+to quickly create a new README file.14+15+## Top-level items16+17+**Badges** (optional): At the very top (with no subheading), include any18+applicable badges, such as npm version/downloads, build status, test coverage,19+and so on. Badges should resolve properly (not display a broken image).20+21+Possible badges include:22+- npm version: `[![NPM Version][npm-image]][npm-url]`23+- npm downloads: `[![NPM Downloads][downloads-image]][downloads-url]`24+- Build status: `[![Build Status][travis-image]][travis-url]`25+- Test coverage: `[![Test Coverage][coveralls-image]][coveralls-url]`26+- Tips: `[![Gratipay][gratipay-image]][gratipay-url]`27+28+**Summary**: Following badges, provide a one- or two-sentence description of29+what the module does. This should be the same as the npmjs.org blurb (which30+comes from the description property of `package.json`). Since npm doesn't31+handle markdown for the blurb, avoid using markdown in the summary sentence.32+33+**TOC** (Optional): For longer READMEs, provide a table of contents that has34+a relative link to each section. A tool such as35+[doctoc](https://www.npmjs.com/package/doctoc) makes it very easy to generate36+a TOC.37+38+## Overview39+40+Optionally, include a section of one or two paragraphs with more high-level41+information on what the module does, what problems it solves, why one would42+use it and how. Don't just repeat what's in the summary.43+44+## Installation45+46+Required. This section is typically just:47+48+```sh49+$ npm install module-name50+```51+52+But include any other steps or requirements.53+54+NOTE: Use the `sh` code block to make the shell command display properly on55+the website.56+57+## Basic use58+59+- Provide a general description of how to use the module with code sample.60+ Include any important caveats or restrictions.61+- Explain the most common use cases.62+- Optional: a simple "hello world" type example (where applicable). This63+ example is in addition to the more comprehensive [example section](#examples)64+ later.65+66+## API67+68+Provide complete API documentation.69+70+Formatting conventions: Each function is listed in a 3rd-level heading (`###`),71+like this:72+73+```74+### Function_name(arg, options [, optional_arg] ... )75+```76+77+**Options objects**78+79+For arguments that are objects (for example, options object), describe the80+properties in a table, as follows. This matches the formatting used in the81+[Express API docs](https://expressjs.com/en/4x/api.html).82+83+|Property | Description | Type | Default|84+|----------|-----------|------------|-------------|85+|Name of the property in `monospace`. | Brief description | String, Number, Boolean, etc. | If applicable.|86+87+If all the properties are required (i.e. there are no defaults), then you88+can omit the default column.89+90+Instead of very lengthy descriptions, link out to subsequent paragraphs for91+more detailed explanation of specific cases (e.g. "When this property is set92+to 'foobar', xyz happens; see <link to following section >.)93+94+If there are options properties that are themselves options, use additional95+tables. See [`trust proxy` and `etag` properties](https://expressjs.com/en/4x/api.html#app.settings.table).96+97+## Examples98+99+Every README should have at least one example; ideally more. For code samples,100+be sure to use the `js` code block, for proper display in the website, e.g.:101+102+```js103+var csurf = require('csurf')104+...105+```106+107+## Tests108+109+What tests are included.110+111+How to run them.112+113+The convention for running tests is `npm test`. All our projects should follow114+this convention.115+116+## Contributors117+118+Names of module "owners" (lead developers) and other developers who have119+contributed.120+121+## License122+123+Link to the license, with a short description of what it is, e.g. "MIT" or124+whatever. Ideally, avoid putting the license text directly in the README; link125+to it instead.