npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

m19wq922

v2.0.4

Published

This npm package provide some common js functions.

Downloads

43

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 :

var m19wq922 = require("m19wq922");

Functions

1.Random string generator

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 :

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!?#$%&'()[]{}*+-/.,:<>=@~". "aA0" includes "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789". "aA" includes "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ". "A0" includes "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789". "a0" includes "abcdefghijklmnopqrstuvwxyz0123456789". "A" includes "ABCDEFGHIJKLMNOPQRSTUVWXYZ". "a" includes "abcdefghijklmnopqrstuvwxyz".

Otherwise, you can use "0" to generate a random number. For example :

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

m19wq922.sum(ARRAY);

This function is used to get the sum of array. For example :

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 :

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

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

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

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

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.