# m19wq922

> This npm package provide some common js functions.

Latest version **2.0.4** (published 2022-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install m19wq922
pnpm add m19wq922
yarn add m19wq922
bun add m19wq922
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2022-04-21 |
| First published | 2022-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 91d906h4 |
| Maintainers | 91d906h4 |
| Keywords | m19wq922 |

## Links

- npm: https://www.npmjs.com/package/m19wq922
- Repository: https://github.com/91d906h4/m19wq922
- Homepage: https://github.com/91d906h4
- Issues: https://github.com/91d906h4/m19wq922/issues
- npm.io page: https://npm.io/package/m19wq922

## Recent versions

- 2.0.4 (latest) — 2022-04-21
- 2.0.3 — 2022-04-21
- 2.0.2 — 2022-04-21
- 2.0.1 — 2022-04-21
- 1.0.38 — 2022-04-21
- 1.0.37 — 2022-04-20
- 1.0.36 — 2022-04-20
- 1.0.35 — 2022-04-20
- 1.0.34 — 2022-04-20
- 1.0.33 — 2022-04-20
- 1.0.32 — 2022-04-20
- 1.0.31 — 2022-04-20
- 1.0.30 — 2022-04-20
- 1.0.29 — 2022-04-19
- 1.0.28 — 2022-04-19
- … 24 more at https://npm.io/package/m19wq922/versions

## README

# Information

    name :              m19wq922
    author :            91d906h4
    version :           2.0.4
    description :       This npm package provide some common js functions.
    main :              index.js
    license :           MIT
    registry :          https://registry.npmjs.org/

# Installation

    npm install m19wq922

And import m19wq922 with the following line :

```js
var m19wq922 = require("m19wq922");
```

# Functions

## 1.Random string generator

```js
m19wq922.rand(STRING, LENGTH);
```

This function is used to generate a random string. The variable "LENGTH" determines the length of random string, and the variable "STRING" determines the element of the string. For example :

```js
m19wq922.rand("abcdefghijklmnopqrstuvwxyz", 8);
```

This line will generate a string that has 8 characters that includes a to z.

And you can also use "aA0!", "aA0", "aA", "A0", or "a0" to determine the characters that you want to use in the random string.

> "aA0!" includes "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?#$%&'()[]{}*+-/.,:<>=@~".<br>
> "aA0" includes "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".<br>
> "aA" includes "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".<br>
> "A0" includes "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".<br>
> "a0" includes "abcdefghijklmnopqrstuvwxyz0123456789".<br>
> "A" includes "ABCDEFGHIJKLMNOPQRSTUVWXYZ".<br>
> "a" includes "abcdefghijklmnopqrstuvwxyz".

Otherwise, you can use "0" to generate a random number. For example :

```js
m19wq922.rand("0", 8);
```

This line will generate a 8-length random number. Variable "LENGTH" must be a number and variable "STRING" must be a string.

## 2.Get sum of array

```js
m19wq922.sum(ARRAY);
```

This function is used to get the sum of array. For example :

```js
m19wq922.sum([0, 1, 2, 3, 4, 5]);
```

This line will return number 15 (0 + 1 + 2 + 3 + 4 + 5), and the following lines will return string becuse there are strings in the array :

```js
m19wq922.sum([0, 1, 2, 3, 4, "5"]); // return "012345"
m19wq922.sum([0, 1, 2, 3, 4, "a"]); // return "01234a"
```

The variable "ARRAY" must be an array.

## 3.Remove element from array

```js
m19wq922.remove(ARRAY, ELEMENT);
```

This function is used to remeove element form an array. The variable "ELEMENT" determines the element you want to remove from "ARRAY". The variable "ARRAY" must be an array.

## 4.Sort array

```js
m19wq922.sort(ARRAY[, true/false]);
```

This function is used to sort array by value. The option true/false determine the order is in order or reverse. The default value is true.

## 5.Regular expression

```js
m19wq922.regex(STRING, RULE);
```

This function is used to check if variable "STRING" is match to the regular expression. And you can use the following rules : "email", "url", "ip", "date", "number" and "text". Also, you can just enter your custom rule.

## 6.Get cookie

```js
m19wq922.getcookie(COOKIE);
```

This function is used to get the cookie from browser. The variable "COOKIE" determines the name of cookie you want. Variable "COOKIE" must be a string.

---
_Source: https://npm.io/package/m19wq922 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
