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 🙏

© 2025 – Pkg Stats / Ryan Hefner

deepwise-fusion-lib

v1.0.13

Published

超融合公共库

Readme

deepwise-fusion-lib

超融合公共库

Usage

安装

修改源: npm config set registry  http://172.16.41.100:4873/

npm install deepwise-fusion-lib

引入一些scss变量

import 'deepwise-fusion-lib/theme/vars.scss'

覆盖element ui 默认样式

在项目入口文件引入:
import 'deepwise-fusion-lib/theme/element-cover.scss'

加解密

import {secret} from 'deepwise-fusion-lib'

加密:
let base64 = secret.encrypt('content')

解密(包含双重解密):
let content = secret.decrypt('base64')

对象字段按ASCII码顺序排序
let nb = secret.sortObj(ob)

数据验签
let sign = secret.getSign(timestamp, ob)

登陆信息

import {auth} from 'deepwise-fusion-lib'

存储token, 主应用在用
auth.setToken(token)

存储用户信息,主应用在用
auth.setUser(user)

获取token
let token = auth.getToken()

获取用户信息
let user = auth.getUser()

http工具

import { Message } from 'element-ui'
import {http, auth} from 'deepwise-fusion-lib'
import {decrypt} from 'deepwise-fusion-lib/packages/Secret'
import config from '../config/'

let decryptor = null
// 条件编译 tree shake掉decrypt 防止密码泄漏
if(process.env.DW_ENV === 'dev') {
  decryptor = decrypt
} else {
  decryptor = window.decrypt
}

var BASE_URL = config.BASE_URL

export default {
  post(url, data = {}, throwErr = false, headers = {}, autoEncrypt = true) {
    return this.request('POST', BASE_URL + url, data, throwErr, headers, autoEncrypt)
  },
  get(url, data = {}, throwErr = false, headers = {}, autoEncrypt = true) {
    return this.request('GET', BASE_URL + url, data, throwErr, headers, autoEncrypt)
  },
  request(method, url, data = {}, throwErr, headers, autoEncrypt = true) {
    const request = method === 'GET' ? http.get.bind(http) : http.post.bind(http)
    
    return new Promise((resolve, reject) => {
      request(url, data, headers, autoEncrypt).then(res => {
        if(res.ret === 0) {
          resolve(JSON.parse(decryptor(res.data)))
        } else if(res.ret === '失效code') {
          auth.clear()
          window.location.href = '/login'
        } else if(throwErr) {
          reject(res)
        } else {
          Message.error(res.msg)
        }
      })
    })
  },
},
uploadFile(file, data = {}, headers = {}, throwErr = false) {
    return new Promise((resolve, reject) => {
      http.uploadFile(userBaseUrl + '/uploadFile', file, data, headers, config.ENCRYPT).then(res => {
        console.log(res)
        if(res.ret === 0) {
          if(!res.encrypt || res.data === null) {
            resolve(res.data)
          } else {
            resolve(JSON.parse(decryptor(res.data)))
          }
        } else if(res.ret === '失效code') {
          auth.clear()
          window.location.href = '/login'
        } else if(throwErr) {
          reject(res)
        } else {
          Message.error(res.msg)
        }
      })
    })
  }