ammunition-storage
v0.0.3
Published
弹药库
Downloads
2
Readme
Ammunition Storage
各种公共工具
JavaScript API
用法:
...
<script src="./dist/ammunition-0.0.1.min.js"></script>
<script>
var ammunition = new Ammunition();
ammunition.init();
</script>
...
说明:
md5
: md5 加密;var ammunition = new Ammunition(); var date = new Date(); var dateString = date.valueOf().toString(); console.log(ammunition.md5(dateString));
cookieUtil
: cookie 操作。var ammunition = new Ammunition(); var cookieUtil = ammunition.cookieUtil; cookieUtil.set('name', 'WJT20', 1); console.log(cookieUtil.get('name'));
Node.js API
用法:
npm i -D ammunition-storage
说明:
init
: 初始化。const ammunition = require('./index.js'); ammunition.init(); console.log((new Date()).format('yyyy-MM-dd hh:mm'));
copyDir
: 拷贝目录。const path = require('path'); const ammunition = require('./index.js'); ammunition.copyDir({ srcPath: path.resolve(__dirname, './src'), tgtPath: path.resolve(__dirname, './dist') });
DATE: 2018-07-30