build: eslint@7.32.0
[express.git] / Readme-Guide.md
blob34d4648b9c294fb86de4885fd321ff6bd3788b4d
1 # README guidelines
3 Every module in the expressjs, pillarjs, and jshttp organizations should have
4 a README file named `README.md`. The purpose of the README is to:
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 help
8   people find it via search. Middleware module READMEs are also incorporated
9   into https://expressjs.com/en/resources/middleware.html.
10 - Encourage community contributions and participation.
12 Use the [README template](https://github.com/expressjs/express/wiki/README-template)
13 to quickly create a new README file.
15 ## Top-level items
17 **Badges** (optional): At the very top (with no subheading), include any
18 applicable badges, such as npm version/downloads, build status, test coverage,
19 and so on. Badges should resolve properly (not display a broken image).
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]`
28 **Summary**: Following badges, provide a one- or two-sentence description of
29 what the module does. This should be the same as the npmjs.org blurb (which
30 comes from the description property of `package.json`). Since npm doesn't
31 handle markdown for the blurb, avoid using markdown in the summary sentence.
33 **TOC** (Optional): For longer READMEs, provide a table of contents that has
34 a relative link to each section. A tool such as
35 [doctoc](https://www.npmjs.com/package/doctoc) makes it very easy to generate
36 a TOC.
38 ## Overview
40 Optionally, include a section of one or two paragraphs with more high-level
41 information on what the module does, what problems it solves, why one would
42 use it and how.  Don't just repeat what's in the summary.
44 ## Installation
46 Required. This section is typically just:
48 ```sh
49 $ npm install module-name
50 ```
52 But include any other steps or requirements.
54 NOTE: Use the `sh` code block to make the shell command display properly on
55 the website.
57 ## Basic use
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). This
63   example is in addition to the more comprehensive [example section](#examples)
64   later.
66 ## API
68 Provide complete API documentation.
70 Formatting conventions: Each function is listed in a 3rd-level heading (`###`),
71 like this:
73 ```
74 ### Function_name(arg, options [, optional_arg]  ... )
75 ```
77 **Options objects**
79 For arguments that are objects (for example, options object), describe the
80 properties in a table, as follows. This matches the formatting used in the
81 [Express API docs](https://expressjs.com/en/4x/api.html).
83 |Property | Description | Type | Default|
84 |----------|-----------|------------|-------------|
85 |Name of the property in `monospace`. | Brief description | String, Number, Boolean, etc. | If applicable.|
87 If all the properties are required (i.e. there are no defaults), then you
88 can omit the default column.
90 Instead of very lengthy descriptions, link out to subsequent paragraphs for
91 more detailed explanation of specific cases (e.g. "When this property is set
92 to 'foobar', xyz happens; see <link to following section >.)
94 If there are options properties that are themselves options, use additional
95 tables. See [`trust proxy` and `etag` properties](https://expressjs.com/en/4x/api.html#app.settings.table).
97 ## Examples
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.:
102 ```js
103 var csurf = require('csurf')
107 ## Tests
109 What tests are included.
111 How to run them.
113 The convention for running tests is `npm test`. All our projects should follow
114 this convention.
116 ## Contributors
118 Names of module "owners" (lead developers) and other developers who have
119 contributed.
121 ## License
123 Link to the license, with a short description of what it is, e.g. "MIT" or
124 whatever. Ideally, avoid putting the license text directly in the README; link
125 to it instead.