You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,45 @@ This package will generate a random dummy string based on the available set of c
8
8
9
9
To install it you can simply do the following command:
10
10
11
-
```
11
+
```bash
12
12
npm i @smakss/random-string
13
13
or
14
14
yarn add @smakss/random-string
15
15
```
16
16
17
17
to include it with common js module you should do this:
18
18
19
-
```
19
+
```js
20
20
var randomString =require('@smakss/random-string');
21
21
```
22
22
23
23
and to include it with ECMAscript module you can simply do this one:
24
24
25
-
```
25
+
```js
26
26
importrandomStringfrom'@smakss/random-string';
27
27
```
28
28
29
29
then to use it within your application you can do it just like this:
30
30
31
+
```js
32
+
randomString();
33
+
34
+
// Result: 'epTfoad497&p'
35
+
// If the input params were empty the length of string will be selected randomly between 1-20.
36
+
```
37
+
38
+
```js
39
+
randomString(10);
40
+
41
+
// Result: 'BD@Z8dKf2%'
42
+
// This will generate a random string with a length of 10.
31
43
```
32
-
randomString(); // If the input params were empty the length of string will be selected randomly between 1-20. So it will generate a string like: 'epTfoad497&p'
33
44
34
-
randomString(10); // This will generate a random string with a length of 10. The output should be something like this: 'BD@Z8dKf2%'
45
+
```js
46
+
randomString(10, 'abCD#@');
35
47
36
-
randomString(10, 'abCD#@'); // You can provide both length and allowed characters. So the result will be something like this: 'b@@#aDaC##'
48
+
// Result: 'b@@#aDaC##'
49
+
// You can provide both length and allowed characters.
0 commit comments