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

pazlweb

v1.1.3

Published

<!-- * @Author: wangchunsheng045 [email protected] * @Date: 2021-11-16 19:36:31 * @LastEditors: wangchunsheng045 [email protected] * @LastEditTime: 2022-06-01 07:48:07 * @FilePath: /common-code/README.md * @Description: 这是默

Downloads

17

Readme

测试

本地保存文件

  • API:
   /* 保存文件至本地 */
   /* res: 完整的文件流数据 fileName:文件名(可选) */
   export  function saveFileByStream(res, filelName): void;
   /* base64: 完整的base64数据 fileName:文件名(可选) */
   export  function saveFileByBase64(base64, fileName): void;
   /* url: 文件的url fileName:文件名(可选) */
   export  function saveFileByUrl(url, fileName): void;
   /* fileName:文件名 */
   export  function getExt(url, fileName): string;
  • 示例:
   import { saveFileByUrl } from 'pazlweb' // 1.引入
   saveFileByUrl(url, 'test.png'); // 根据url下载 

判断类型

// 可以导出函数:  细节请看源码
isFunction()、isString()、isNumber()、isArray()、isMap()、isSet()、isDate()、isSymbol()、isObject()、isPromise()

脱敏

总部脱敏规则

  • 客户姓名: 保留姓,其余屏蔽 王建国;Michale Jordan 王**;*** Jordan
  • 手机号:
    • 大陆:显示前3位和后4位
    • 香港:澳门:显示前2位和后2位(如:90****85)
    • 台湾:显示前2位和后3位(如:90****856)
    • 其他海外地区:连续屏蔽自第四位开始的4位数字 17812345678 178****5678
    • 固定电话: 保留区号和后2位,其余屏蔽 02147593745 021******45
  • 电子邮箱:
    • @前面字符显示前3位,后面加三个*,@后面完整显示;
    • 如果@前面字符少于三位,则全部展示,并在后面加三个*,@后面完整显示;
  • 银行卡号:
    • 多于10位:保留前6位,后4位,其余屏蔽;
    • 10位或更短时:屏蔽第3位到倒数第3位 6257983556363363225403 625798************5403
  • 身份证号: 保留前4位和后4位 422302193740323000 422***********3000
  • 家庭住址: -地址为中文:显示国家、省、地级市,其余屏蔽;
  • 地址为非中文:保留总字符个数的前一半,其余屏蔽 广东省深圳市福田区益田路5033号平安金融中心22楼 广东省深圳市*******
  • 车架号 展示前4位和后4位 SLD15CK4721155214 SLD1*********5214
import { shelter } from 'pazlweb' // 1.引入
shelter('李狗蛋', 1);  // 调用 -> 李**
/**
* @description: 脱敏通用方法(对以下方法的简单封装)
* @str: {string} 要脱敏的字符
* @type: { number } 类型: 1: 用户名 2: 手机号 3: 邮箱 4: 银行卡 5: 身份证 6: 地址 7: 车架号 
* @return: {string} 脱敏后的结果
*/
export function shelter(str, type):string

/**
* @description: 用户名脱敏(支持中/英文)
* @userName: {string} 用户名
* @return: {string} 脱敏后的用户名
*/
export function shelterUserName(userName):string


/**
* @description: 用户名脱敏(支持中/英文)
* @UserName: {string} 用户名
* @return: {string} 脱敏后的用户名
*/
export function shelterUserName(UserName):string

/**
* @description: 脱敏手机号
* @PhoneNumber: {string} 手机号
* @return: {string} 脱敏后的v
*/
export function shelterPhoneNumber(PhoneNumber):string
/**
* @description: 脱敏邮箱
* @email: {string} 邮箱
* @return: {string} 脱敏后的邮箱
*/
export function shelterEmail(email):string
/**
* @description: 脱敏银行卡
* @backCard: {string} 银行卡
* @return: {string} 脱敏后银行卡
*/
export function shelterBankCard(backCard):string
/**
* @description: 脱敏身份证
* @idCard: {string} 身份证
* @return: {string} 脱敏后身份证
*/
export function shelterIdCard(idCard):string

/**
* @description: 脱敏身份证
* @idCard: {string} 身份证
* @return: {string} 脱敏后身份证
*/

export function shelterAddress(idCard):string
/**
* @description: 脱敏车架号
* @carNumber: {string} 车架号
* @return: {string} 脱敏后车架号
*/
export function shelterCarNumber(carNumber):string

npm 推送

   0- nrm use npm  连主站
   1- npm login 先登录
   2- npm publish 推送