用TypeScript封装的一个JavaScript函数库

funclib.js (凡客杰斯)

npm LICENSE MIT Build Status

简单介绍

目的:高效率完成前端业务代码!

funclib.js 是一个简单、易用、贴进业务逻辑的JavaScript UMD函数库,类似于 underscore 和 lodash。 跟它们对比,funclib.js省去了很多js自带的或者不常用的方法。

funclib.js还根据一些实际业务的逻辑的规律封装了很多前后端都实用的新方法, 让你提高代码质量和交付效率的同时,享受编程的乐趣!

funclib.js使用 TypeScript 进行开发,使用 WebPack 进行打包编译,使用 Karma / Mocha 进行单元测试, 使用 Travis-CI 进行持续集成。

访问地址:

快速上手

# Install funclib.js
$ npm install funclib

# Use funclib
$ node
> var fn = require('funclib');
> console.log(fn.rdid()) // => 8GH9IYO60MXQ

克隆代码

# Download funclib repo
$ git clone https://github.com/CN-Tower/funclib.js.git
# $ git clone http://gitlab.zte.com.cn/CN-Tower/funclib.js.git

# Install dependency
$ npm install

# Start
$ npm start

# Do Try
$ npm run usage

# Build
$ npm run build

# Test
$ npm run test

项目结构

funclib.js
├── node_modules/           # You know the drill...
├── assets                  # 构建目录
│   ├── funclib.js          # 未压缩版
│   ├── funclib.min.js      # 压缩版
│   ├── index.d.ts          # 定义文件
│   ├── index.js            # 索引文件
│   ├── package.json        # 库模块定义
│   └── README.md           # Read this FIRST :)
├── script                  # 脚本
│   ├── build.js            # 编译脚本
│   ├── karma.conf.js       # Karma配置
│   └── webpack.conf.js     # Webpack配置
├── src                     # Source code
│   ├── modules             # 模块
│   │   ├── _Array.ts       # Array
│   │   ├── _Cookie.ts      # Cookie
│   │   ├── _Dom.ts         # Element
│   │   ├── _FileSys.ts     # FileSystem
│   │   ├── _Function.ts    # Function
│   │   ├── _Math.ts        # Mathematic
│   │   ├── _Object.ts      # Object
│   │   ├── _Pattern.ts     # RegExp
│   │   ├── _Progress.ts    # Progress
│   │   ├── _String.ts      # String
│   │   ├── _Time.ts        # Time
│   │   ├── _Trick.ts       # Trick
│   │   ├── _Type.ts        # Type
│   │   ├── _Url.ts         # Url
│   │   ├── _Logc.ts        # ClientLog
│   │   └── _Logs.ts        # ServerLog
│   ├── funclib.conf.ts     # 配置文件
│   ├── funclib.ts          # ClientMain
│   └── index.ts            # ServerMain
├── test                    # 测试
│   ├── client-methods      # 客户端方法测试用例
│   ├── server-methods      # 服务端方法测试用例
│   └── *.spec.js           # 通用方法测试用例
├── .coveralls.yml          # 测试覆盖率
├── .editorconfig           # Set coding style (indents, charset, etc.)
├── .gitignore              # You know the drill...
├── .travis.yml             # CI配置
├── LICENSE                 # 授权说明
├── package-lock.json       # NPM Lock
├── package.json            # 库配置
├── README.md               # Read this FIRST :)
├── tsconfig.json           # Typescript配置
├── usage.html              # 客户端试验
└── usage.js                # 服务端试验

猜你喜欢

转载自blog.csdn.net/aystvsnd/article/details/81316632