randex 0.8.0 → 0.10.0
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/README.md +18 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# randex
|
|
2
2
|
|
|
3
|
+
TypeScript library to random most common things like filename, username, email, name, full name, etc.
|
|
4
|
+
|
|
3
5
|
<a href="https://www.npmjs.com/package/randex">
|
|
4
6
|
<img src="https://nodei.co/npm/randex.png?mini=true">
|
|
5
7
|
</a>
|
|
6
8
|
|
|
7
|
-
TypeScript library for random thing like string, username, email, name, etc.
|
|
8
|
-
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
Installation:
|
|
@@ -30,7 +30,7 @@ Deeps:
|
|
|
30
30
|
|
|
31
31
|
## random
|
|
32
32
|
|
|
33
|
-
Basic function
|
|
33
|
+
Basic function to construct random things.
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
import { random } from "randex";
|
|
@@ -153,8 +153,8 @@ randomFileName(8, "xml");
|
|
|
153
153
|
Options:
|
|
154
154
|
| Name | Type| Description|
|
|
155
155
|
| ------------------------ | ---- |------------ |
|
|
156
|
-
|fileNameLength|[RandexLength](#randexlength) | Length of file name (not including extension). Default: [3,10]|
|
|
157
|
-
|extensionLength|[RandexLength](#randexlength) | Length of extension (not including file name) chars
|
|
156
|
+
|fileNameLength|[RandexLength](#randexlength) | Length of file name (not including extension). Default: [3,10] |
|
|
157
|
+
|extensionLength|[RandexLength](#randexlength) | Length of extension (not including file name) chars. Default: [2,5] |
|
|
158
158
|
|extension| `string`| File extension. |
|
|
159
159
|
|
|
160
160
|
## randomUsername
|
|
@@ -302,8 +302,10 @@ There are examples how to create custom function for most common cases:
|
|
|
302
302
|
<b>randomFileName</b>
|
|
303
303
|
|
|
304
304
|
```ts
|
|
305
|
-
random([
|
|
306
|
-
|
|
305
|
+
random([
|
|
306
|
+
["english", "number"],
|
|
307
|
+
[3, 10],
|
|
308
|
+
]) +
|
|
307
309
|
"." +
|
|
308
310
|
random([
|
|
309
311
|
["english", "l"],
|
|
@@ -326,13 +328,19 @@ random(
|
|
|
326
328
|
<b>randomEmail</b>
|
|
327
329
|
|
|
328
330
|
```ts
|
|
329
|
-
random([
|
|
331
|
+
random([
|
|
332
|
+
[["english", "l"], "number"],
|
|
333
|
+
[6, 10],
|
|
334
|
+
]) +
|
|
330
335
|
"@" +
|
|
331
|
-
random(["english", "l"], [["english", "l"], "-", [0, 5]], ["english", "l"]) +
|
|
332
|
-
"." +
|
|
333
336
|
random([
|
|
334
337
|
["english", "l"],
|
|
335
338
|
[2, 4],
|
|
339
|
+
]) +
|
|
340
|
+
"." +
|
|
341
|
+
random([
|
|
342
|
+
["english", "l"],
|
|
343
|
+
[1, 6],
|
|
336
344
|
]);
|
|
337
345
|
```
|
|
338
346
|
|