Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smakss/random-string

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smakss/random-string - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

2

package.json
{
"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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc