Skip to content

Commit 968dfe6

Browse files
committed
Readme.md got updated
Language added for all snippets
1 parent 9a3f4d7 commit 968dfe6

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

Readme.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,45 @@ This package will generate a random dummy string based on the available set of c
88

99
To install it you can simply do the following command:
1010

11-
```
11+
```bash
1212
npm i @smakss/random-string
1313
or
1414
yarn add @smakss/random-string
1515
```
1616

1717
to include it with common js module you should do this:
1818

19-
```
19+
```js
2020
var randomString = require('@smakss/random-string');
2121
```
2222

2323
and to include it with ECMAscript module you can simply do this one:
2424

25-
```
25+
```js
2626
import randomString from '@smakss/random-string';
2727
```
2828

2929
then to use it within your application you can do it just like this:
3030

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.
3143
```
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'
3344

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#@');
3547

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.
3750
```
3851

3952
## Demo

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smakss/random-string",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Generates random dummy string with random length.",
55
"type": "module",
66
"main": "index.cjs",

0 commit comments

Comments
 (0)