Skip to content

Commit 0f5be67

Browse files
committed
update README
- prep for public npm consumption - simplify / rework a little
1 parent c091612 commit 0f5be67

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

reference-lib/README.md

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
# Reference Library
2-
NGINX directive reference in Markdown and HTML format
3-
4-
# Installation
5-
6-
1. Generate a github personal access token with read:packages permission
7-
2. Create a ~/.npmrc file with the following content
8-
```
9-
@nginxinc:registry=http://npm.pkg.github.com
10-
//npm.pkg.github.com/:_authToken=$TOKEN
11-
```
12-
3. Run
13-
```bash
14-
npm install --save @nginx/[email protected]
15-
```
16-
17-
# Usage
18-
1. find
19-
```javascript
20-
import { find, Format } from '@nginx/reference-lib'
21-
const content = find('listen', undefined, Format.HTML)
22-
```
23-
24-
2. getDirectives
25-
```javascript
26-
import { getDirectives, Format } from '@nginx/reference-lib'
27-
const directive = getDirectives(Format.HTML)
28-
```
2+
3+
Machine-readable NGINX directive documentation, with Markdown and HTML formats.
4+
5+
This library is generated from the official NGINX documentation, and intended for use in other tools that work with NGINX configuration files. This provides more accurate and up-to-date information than web scraping <https://nginx.org>.
6+
7+
Every time the NGINX documentation changes, this library will be updated and published with a new version number.
8+
9+
## Installation
10+
11+
`npm install --save @nginx/reference-lib`
12+
13+
## Usage
14+
15+
We export two functions (with type definitions) to navigate the documentation:
16+
17+
1. `getDirectives` returns a flat list of all directives in any official module
18+
2. `find` returns a specific directive by name
19+
20+
See [examples](./examples) for more usage.

0 commit comments

Comments
 (0)