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

mp_common

v1.7.1

Published

magicalpixi common lib

Downloads

10

Readme

#mp_common

install

npm install --save mp_common

test

node test.js

config

mp_common 暂时需要一个encode的秘钥来完成配置,含有一个默认的秘钥,但是不推荐使用默认

var common = require('mp_common')
common.create({key: 'your secret key'})

或者

var common = require('mp_common').create({key: 'your secret key'})

modules

create:

/**
 * @param  {[Obj]} opt [opt.key 是加密秘钥]
 * @return {[mp_common]} [common 的单利对象]
 */
create = (opt) => {
  // 配置单例common对象
  return common
}

statics: 申明了各种键名

user_id // 用户Id键名
auth_id // cookie id键名
auth // 综合头部信息加密验证值的键名
expire_time // 身份验证过期时间值的键名
server_key // 服务器身份验证键名

auth:

check = (obj) => {
  // 检查对象中键值并进行校验,看是否为合法的对象
  return Boolean
}

generate = (uid, expire, authid) => {
  // 生成auth信息并处理成键值对返回
  return authObj
}

encode:

encode (text) => {
  // 通过加密算法获取到秘文, 不可逆
  return String
}

header:

browser = (userid, authid, auth, expire_time) => {
  return Object
}

server = (server_key_seed) => {
  return Object
}

request:

/**
 * 针对dbserver的请求
 * @param {[String]} scheme [对应dbserver的scheme]
 * @param {[String]} name   [对应dbserver的modelname]
 */
Request = (scheme, name) => {
  return RequestObject
}

//RequestObject 的 方法
create = (data, header) => {
  return PromiseObj
}
get = (query, header) => {
  return PromiseObj
}
getAll = (header) => {
  return PromiseObj
}

StringUril:

addQuery = (url, params) => {
  // append params into url
  return String
}