New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@moohng/dan

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moohng/dan

js工具库

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

dan.js

Node.js CI Node.js Package

npm npm GitHub

实用工具函数库,最新版已全面支持 typescript:

  • acc 浮点数精确计算,推荐使用 big.js
  • validator 字段校验
  • copy 复制文本
  • cut 截取小数位数
  • decimalPadEnd 小数末尾补0
  • es6tpl es6字符串模板
  • splitFormat 字符串分割
  • moneyFormat 金额格式化(千分位逗号隔开)
  • random 生成随机数/字符串
  • round 近似小数位数
  • merge 对象深合并
  • decode URI解码
  • encode URI编码
  • querystring 解析query字符串到对象
  • querystringify query对象字符串化
  • dateFormat 日期格式化
  • timeFormat 时间戳转时分秒
  • unique 数组去重
  • sleep 等待

安装

# npm
$ npm i -S @moohng/dan
# or yarn
$ yarn add @moohng/dan

使用

ES Module

// 全部引入
import * as dan from '@moohng/dan'
// 单个引入
import { validator } from '@moohng/dan'
import validator from '@moohng/dan/lib/validator'

浏览器

<!-- 锁定版本号 -->
<script src=//cdn.jsdelivr.net/npm/@moohng/dan@1.3.18/dist/dan.min.js></script>
<!-- 使用最新版本 -->
<script src=//cdn.jsdelivr.net/npm/@moohng/dan/dist/dan.min.js></script>

开发

打包

# commonjs
$ yarn build
# browser
$ yarn build:dist

发布

该项目通过 Travis 自动编译和发布到 npm 平台

  • 通过 npm version patch 增加版本号
  • git push 到 GitHub 仓库
  • 通过 GitHub 的 release 发版,会触发 Travis 平台执行编译和测试指令,通过之后会自动 publish 到 npm 平台

项目使用 github workflows 自动编译检查和发布到 npm 平台

Keywords

FAQs

Package last updated on 24 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc