Skip to content

Commit 9e165f0

Browse files
committed
Show proper file + export usage in readme
1 parent 7845fc7 commit 9e165f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ $ npm install postgres
2020

2121
**Use**
2222
```js
23-
23+
// db.js
2424
const postgres = require('postgres')
2525

2626
const sql = postgres({ ...options }) // will default to the same as psql
2727

28+
module.exports = sql
29+
```
30+
31+
```js
32+
// other.js
33+
const sql = require('./db.js')
34+
2835
await sql`
2936
select name, age from users
3037
`

0 commit comments

Comments
 (0)