-
cross-env 跨平台设置和使用环境变量
设置
{
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config build/webpack.config.js"
}
}
使用
const NODE_ENV = process.env.NODE_ENV;
if(NODE_ENV==='production'){
}else{
}
参考:
https://www.jianshu.com/p/696bd579f9ec
https://blog.csdn.net/qq_26927285/article/details/78105510
https://github.com/kentcdodds/cross-env
-
decimal.js 金额计算
A Decimal is immutable in the sense that it is not changed by its methods.
0.3 - 0.1 // 0.19999999999999998
x = new Decimal(0.3)
x.minus(0.1) // '0.2'
x // '0.3'
参考:
https://github.com/MikeMcl/decimal.js
http://mikemcl.github.io/decimal.js/
JS判断是不是Decimal类型(正则实现) https://www.cnblogs.com/xachary/p/3631178.html
-
crypto
JavaScript library of crypto standards.
加解密
https://github.com/brix/crypto-js
网友评论