A small JavaScript tool library.
Package with rollup.js
, exported as iife cmd cjs umd
module.
npm install @wolfzwz/javascript-tool-library
import {
find
} from '@wolfzwz/javascript-tool-library';
var data = [{
userId: 8,
title: 'title1'
},
{
userId: 11,
title: 'other'
},
{
userId: 15,
title: null
},
{
userId: 19,
title: 'title2'
}
];
//查找data中,符合条件的数据,并进行排序
var result = find(data).where({
"title": /\d$/
}).orderBy('userId', 'desc');
console.log(result);
// [{ userId: 19, title: 'title2'}, { userId: 8, title: 'title1' }];
Can also import like
import tool from '@wolfzwz/javascript-tool-library';
console.log(tool.find); // Function
https://github.com/wolfzwz/javascript-tool-library
Requires node >= 10 and Git >= 2.13.0.
或者使用cnpm代替npm
npm install --global rollup
npm install
npm install eslint --save-dev
如果启动项目时提示某个依赖没有安装,单独安装就可以
npm run lint
npm run eslint-format
通过命令行提交代码 一般来说,commit message 应该清晰明了,说明本次提交的目的, 所以需要一些规范来使这些comment变得可读
npm run commit
保证规范化git的commit信息 Existing hooks are kept. Requires Node >= 10 and Git >= 2.13.0.
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
npm run test
运行命令后查看目录/dist
npm run build
npm run release
支持搜索 支持global函数和class 支持点击跳转代码行 运行命令后查看目录/docs
npm run docs
发布共有npm库 可以搭建私服,发布到私服
npm publish --access public
Released under the MIT Licenses.