Skip to content

Commit a44a2ef

Browse files
committed
Add missing usage examples
1 parent 5a1b382 commit a44a2ef

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
Next.js and [node-config][], together at last.
44

5-
```console
6-
$ npm install next-plugin-node-config
5+
Install with npm:
6+
7+
```sh
8+
npm install next-plugin-node-config
79
```
810

9-
```console
10-
$ yarn add next-plugin-node-config
11+
Install with Yarn:
12+
13+
```sh
14+
yarn add next-plugin-node-config
1115
```
1216

1317
## Why?
@@ -51,29 +55,29 @@ returns.
5155

5256
## Usage
5357

54-
Add some configuration files, for example `config/default.js`, then add the
58+
Add some configuration files, for example `config/default.js`, then add this
5559
plugin to `next.config.js`.
5660

5761
Simplest usage with no existing Next.js config:
5862

5963
```js
60-
const withNodeConfig = require('next-plugin-node-config');
64+
const withNodeConfig = require("next-plugin-node-config");
6165

6266
module.exports = withNodeConfig();
6367
```
6468

6569
With existing Next.js config:
6670

6771
```js
68-
const withNodeConfig = require('next-plugin-node-config');
72+
const withNodeConfig = require("next-plugin-node-config");
6973

7074
module.exports = withNodeConfig({
7175
// These will be merged on top of anything that comes from `config`!
7276
serverRuntimeConfig: {
73-
secret: 'entropy9'
77+
secret: "entropy9"
7478
},
7579
publicRuntimeConfig: {
76-
api: '/graphql'
80+
api: "/graphql"
7781
},
7882
webpack(config, options) {
7983
// ...
@@ -87,11 +91,11 @@ Using the `nodeConfigServerKey` and `nodeConfigPublicKey` options,
8791
your config files:
8892

8993
```js
90-
const withNodeConfig = require('next-plugin-node-config');
94+
const withNodeConfig = require("next-plugin-node-config");
9195

9296
module.exports = withNodeConfig({
93-
nodeConfigServerKey: 'server',
94-
nodeConfigPublicKey: 'public'
97+
nodeConfigServerKey: "server",
98+
nodeConfigPublicKey: "public"
9599
});
96100
```
97101

0 commit comments

Comments
 (0)