1.0.9 • Published 5 years ago
@wolfzwz/javascript-tool-library v1.0.9
javascript-tool-library
A small JavaScript tool library.
Package with rollup.js , exported as iife cmd cjs umd module.
Install
npm install @wolfzwz/javascript-tool-libraryUsage
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
如果启动项目时提示某个依赖没有安装,单独安装就可以命令行执行eslint检测
npm run lint命令行格式化代码
npm run eslint-format命令行执行提交
通过命令行提交代码 一般来说,commit message 应该清晰明了,说明本次提交的目的, 所以需要一些规范来使这些comment变得可读
npm run commithooks
保证规范化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包
运行命令后查看目录/dist
npm run build命令行生成CHANGELOG
npm run release命令行生成文档
支持搜索 支持global函数和class 支持点击跳转代码行 运行命令后查看目录/docs
npm run docs命令行发布到npm
发布共有npm库 可以搭建私服,发布到私服
npm publish --access publicLicense
Released under the MIT Licenses.