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 🙏

© 2024 – Pkg Stats / Ryan Hefner

m2-nodejs

v1.0.1

Published

The package is provided utilities and facilities for nodejs.

Downloads

5

Readme

m2-nodejs

The package is provided utilities and facilities for nodejs.

Usage

  • Install
npm install m2-nodejs
yarn add m2-nodejs

APIs

  • mysql Provide nodejs how to connect to mysql

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | connect | func | Get the mysql connection instance for the params config | | | escape | func | Prevent SQL-inject attack to escape the params | | | execSql | func | Exec the sql statement for the params connection, sql | |

  • redis Provide nodejs how to connect to redis

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | connect | func | Get the redis client instance for the params config | | | setItem | func | Set the item into redis for the params client, key, val | | | getItem | func | Get the item from redis for the params client, key | | | delItem | func | Remove the item from redis for the params client, key | |

  • cookie Provide how to operate cookie in the server

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | getCookieExpire | func | Get the cookie expire time for the params {type,offset}} | | | setServerCookie | func | Set the cookie in the server for the params res, key, val, options | |

  • http Provide how to http request and response in the server

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | getPostData | func | Get post data via stream for the params req | | | parseQuery | func | Parse query data or the params req | | | parseCookie | func | Parse cookie data for the params req | | | parseSession | func | Parse session data for the params req,redis | |

  • model Provide data response model include SuccessModel, ErrorModel

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | SuccessModel | class | Provide the data model when data will be fetched | | | ErrorModel | class | Provide the error model when data will be rejected | |

  • util Provide node util function in the server

| prop or func | type | description | example | | ------------ | ------------ | ------------ | ------------ | | readline | func | Provide the readline instance based on read stream | | | writeLog | func | Write the appending log into file | | | md5 | func | Encrypt the content by md5 | | | encryptPassword | func | Encrypt the password by md5 and key | |