ts-id-lite 2.0.18 → 2.0.20
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/LICENSE +21 -0
- package/README.md +6 -8
- package/package.json +5 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gaurang Mody
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ts-id-lite
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/ts-id-lite) [](https://www.npmjs.com/package/ts-id-lite) [](https://www.npmjs.com/package/ts-id-lite) [](https://www.npmjs.com/package/ts-id-lite) [](https://bundlephobia.com/result?p=ts-id-lite)
|
|
4
4
|
|
|
5
5
|
Lightweight, type-safe ID generation utility library for web developers.
|
|
6
6
|
|
|
@@ -23,9 +23,6 @@ export class MyService {
|
|
|
23
23
|
myMethod(): void {
|
|
24
24
|
this.id.uuid(); // '550e8400-e29b-41d4-a716-446655440000'
|
|
25
25
|
this.id.nanoid(); // 'V1StGXR8_Z'
|
|
26
|
-
this.id.shortId(); // random short ID
|
|
27
|
-
this.id.hash('text'); // hash string
|
|
28
|
-
this.id.snowflake(); // snowflake ID
|
|
29
26
|
this.id.generateCode(6, 'numeric'); // '482931'
|
|
30
27
|
}
|
|
31
28
|
}
|
|
@@ -37,11 +34,12 @@ export class MyService {
|
|
|
37
34
|
|--------|-------------|---------|
|
|
38
35
|
| `uuid` | Generate UUID v4 | → `'550e8400-...' ` |
|
|
39
36
|
| `nanoid` | Generate nanoid | → `'V1StGXR8_Z'` |
|
|
40
|
-
| `shortId` | Generate short ID | → random
|
|
41
|
-
| `hash` | Hash string | `'text'` → hash |
|
|
37
|
+
| `shortId` | Generate short alphanumeric ID | → random string |
|
|
42
38
|
| `snowflake` | Generate snowflake ID | → timestamp-based ID |
|
|
43
|
-
| `
|
|
39
|
+
| `hash` | Generate simple string hash | `'text'` → `'abc123'` |
|
|
40
|
+
| `generateCode` | Generate random code | `6, 'numeric'` → `'482931'` |
|
|
41
|
+
| `generateToken` | Generate random hex token | `32` → random hex string |
|
|
44
42
|
|
|
45
43
|
## License
|
|
46
44
|
|
|
47
|
-
MIT
|
|
45
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-id-lite",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
4
4
|
"description": "Lightweight, type-safe ID generation utility library for web developers",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md"
|
|
17
19
|
],
|
|
18
20
|
"scripts": {
|
|
19
21
|
"build": "tsc -p tsconfig.json"
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"helpers",
|
|
27
29
|
"lite"
|
|
28
30
|
],
|
|
29
|
-
"author": "Gaurang Mody
|
|
31
|
+
"author": "Gaurang Mody",
|
|
30
32
|
"license": "MIT",
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|