Coder Social home page Coder Social logo

javascript-tool-library's Introduction

javascript-tool-library

npm npm

A small JavaScript tool library.

Package with rollup.js , exported as iife cmd cjs umd module.

Install

npm install @wolfzwz/javascript-tool-library

Usage

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 commit

hooks

保证规范化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 public

License

Released under the MIT Licenses.

javascript-tool-library's People

Contributors

wolfzwz avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.