human-ids 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +20 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -6,6 +6,18 @@ A library to generate human-readable IDs.
|
|
|
6
6
|
|
|
7
7
|
Human IDs is a JavaScript library that allows you to generate human-readable IDs. The IDs consist of a combination of adjectives, colors, nouns, and numbers, creating unique and memorable identifiers.
|
|
8
8
|
|
|
9
|
+
Supports English and Spanish
|
|
10
|
+
## Output example
|
|
11
|
+
bubbly-beige-fire-38
|
|
12
|
+
breezy-teal-faith-870
|
|
13
|
+
silly-indigo-imagination-440
|
|
14
|
+
genuine-turquoise-light-718
|
|
15
|
+
bubbly-purple-pen-450
|
|
16
|
+
genuine-silver-magic-935
|
|
17
|
+
delightful-brown-planet-642
|
|
18
|
+
cozy-orange-boat-449
|
|
19
|
+
excelente-morado-creatividad-829
|
|
20
|
+
energetico-oliva-libertad-765
|
|
9
21
|
## Installation
|
|
10
22
|
|
|
11
23
|
To use Human IDs in your project, you can install it via npm:
|
|
@@ -15,27 +27,24 @@ npm install human-ids
|
|
|
15
27
|
```
|
|
16
28
|
|
|
17
29
|
```javascript
|
|
18
|
-
|
|
30
|
+
import humanId from 'human-ids'
|
|
19
31
|
|
|
20
|
-
// Initialize the settings object
|
|
32
|
+
// Initialize the settings object (these are the defaults)
|
|
21
33
|
const settings = {
|
|
22
|
-
lang: '
|
|
34
|
+
lang: 'en',
|
|
23
35
|
adjective: true,
|
|
36
|
+
color: true,
|
|
24
37
|
noun: true,
|
|
25
38
|
number: {
|
|
26
39
|
min: 0,
|
|
27
40
|
max: 999,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
41
|
+
sets: 1,
|
|
42
|
+
completeWithZeros: false,
|
|
43
|
+
},
|
|
31
44
|
};
|
|
32
45
|
|
|
33
|
-
// Create an instance of the IdGenerator class
|
|
34
|
-
const idGenerator = new IdGenerator(settings);
|
|
35
|
-
|
|
36
46
|
// Generate an ID using the class instance
|
|
37
|
-
|
|
38
|
-
console.log(id);
|
|
47
|
+
console.log(humanId())
|
|
39
48
|
```
|
|
40
49
|
## Configuration
|
|
41
50
|
|