Skip to content

Commit 31e31ff

Browse files
committed
docs(readme): import stmt
1 parent ebaf948 commit 31e31ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ npm install sqids
5959
Simple encode & decode:
6060

6161
```javascript
62+
import Sqids from 'sqids'
63+
6264
const sqids = new Sqids()
6365
const id = sqids.encode([1, 2, 3]) // "86Rf07"
6466
const numbers = sqids.decode(id) // [1, 2, 3]
@@ -70,6 +72,8 @@ const numbers = sqids.decode(id) // [1, 2, 3]
7072
Enforce a *minimum* length for IDs:
7173

7274
```javascript
75+
import Sqids from 'sqids'
76+
7377
const sqids = new Sqids({
7478
minLength: 10,
7579
})
@@ -80,6 +84,8 @@ const numbers = sqids.decode(id) // [1, 2, 3]
8084
Randomize IDs by providing a custom alphabet:
8185

8286
```javascript
87+
import Sqids from 'sqids'
88+
8389
const sqids = new Sqids({
8490
alphabet: 'FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE',
8591
})
@@ -90,6 +96,8 @@ const numbers = sqids.decode(id) // [1, 2, 3]
9096
Prevent specific words from appearing anywhere in the auto-generated IDs:
9197

9298
```javascript
99+
import Sqids from 'sqids'
100+
93101
const sqids = new Sqids({
94102
blocklist: new Set(['86Rf07']),
95103
})

0 commit comments

Comments
 (0)