@smakss/random-string
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "@smakss/random-string", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Generates random dummy string with random length.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -11,3 +11,3 @@ # Generate random string | ||
``` | ||
```bash | ||
npm i @smakss/random-string | ||
@@ -20,3 +20,3 @@ or | ||
``` | ||
```js | ||
var randomString = require('@smakss/random-string'); | ||
@@ -27,3 +27,3 @@ ``` | ||
``` | ||
```js | ||
import randomString from '@smakss/random-string'; | ||
@@ -34,12 +34,25 @@ ``` | ||
```js | ||
randomString(); | ||
// Result: 'epTfoad497&p' | ||
// If the input params were empty the length of string will be selected randomly between 1-20. | ||
``` | ||
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' | ||
randomString(10); // This will generate a random string with a length of 10. The output should be something like this: 'BD@Z8dKf2%' | ||
```js | ||
randomString(10); | ||
randomString(10, 'abCD#@'); // You can provide both length and allowed characters. So the result will be something like this: 'b@@#aDaC##' | ||
// Result: 'BD@Z8dKf2%' | ||
// This will generate a random string with a length of 10. | ||
``` | ||
```js | ||
randomString(10, 'abCD#@'); | ||
// Result: 'b@@#aDaC##' | ||
// You can provide both length and allowed characters. | ||
``` | ||
## Demo | ||
You can check the [working demo](https://runkit.com/smakss/random-string) in runkit. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55
5118