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

nce-utils-test

v0.1.0

Published

nce 项目公用的工具类

Downloads

1

Readme

nce-utils

nce 项目公用的工具类

地址

http://47.93.124.2/-/web/detail/nce-utils

安装

可以在浏览器中直接使用JavaScript文件 nce-utils.umd.js或通过npm方式安装。

浏览器直接加载

会在全局环境添加NceUtils对象:

<script src='path/to/nce-utils.umd.js'></script>

npm方式

nce-utils发布在世纪高通的镜像源。使用时需要先修改npm的镜像源:

npm config set registry http://47.93.124.2

安装:

npm install nce-utils -S

使用

示例

通过script标签方式引入:

<script>
    let date = NceUtils.dateTool.getFormatDate();
    console.info(date);
</script>

ES module:

import { dateTool } from "nce-utils";
let date = dateTool.getForamtDate();
console.info(date);

模块说明

  • AES
    • generatekey随机生成指定数量的16进制key
    • encrypt加密
    • decrypt解密
  • AES128
    • uuid
    • decrypt
    • encrypt
    • getMixedText
    • getUnMixedText
  • dateTool 日期格式化
    • formatDate
    • getCurrentDayZeroTime
    • getDateStr
    • getCurrentTime
    • getFormatDate
  • featureMeta 地理要素
    • coordEach
    • coordReduce
    • propEach
    • propReduce
    • featureEach
    • featureReduce
    • coordAll
    • geomEach
    • geomReduce
    • feature
    • flattenEach
    • flattenReduce
  • loadTools
    • loadScript
    • loadScriptCode
    • loadScripts
    • removeScript
    • removeScripts
    • loadStyle
    • loadStyleCode
    • loadStyles
    • removeStyle
    • removeStyles
  • MapApiLoader 加载地图Api的类
    • tools
      • removeAllApi
      • load2dBaseApi
      • loadPluginApi
      • load3dBaseApi
      • loadCDNApi
      import { MapApiLoader } from "nce-utils";
      // 创建实例时需要传入url参数
      const mapApiLoader = new MapApiLoader({
            APP_JS_2D_API_URL: "",
            APP_JS_3D_API_URL: "",
            APP_JS_API_PLUGINS_URL: "",
            APP_JS_API_CDN_URL: "",
          });
      console.info(mapApiLoader.tools.loadPluginApi);
  • message
    • 封装element-ui的message
      // main.js
      import { message } from "nce-utils";
      Vue.prototype.$message = message;
      // 使用
      this.$message({
          message: res.msg,
          type: "success",
        });
  • storageUtil
    • setSession
    • getSession
    • removeSession
    • setLocal
    • getLocal
    • removeLocal
  • transformUnit
    • changeSizeUnit 字节单位向上转换
    • changeTimeUnit 秒数转为时长字符串
  • uuidUtil
    • getUuid
    • getUuid_Eight
    • loadjscssfile
    • removejscssfile
    • createjscssfile
    • replacejscssfile
  • validator 校验
    • validateUsername
    • validateMail
    • validatePass
    • validateCheckPass
    • validatePhone
    • validateServicename
  • common
    • getMenuByRouter
    • joinParamToUrl
    • debounce 函数防抖