3.0.3 • Published 6 years ago

toolmanage v3.0.3

Weekly downloads
3
License
ISC
Repository
-
Last release
6 years ago

toolmanage

smart基础组件npm包管理

项目结构

----npmmanage 
        --bin           //命令配置
        --src           //功能文件
        --test          //测试用例
        --.gitignore     //上传过滤配置
        --index.js      //主入口
        --LICENSE       //证书
        --package.json      //版本信息及其依赖
        --README.md     //md文档

项目应用

javaScript

#  引入至项目中
npm install toolmanage

#  项目中使用
import {collect,storage} from toolmanage

实例用法

# collect(收集==>监听生成日志)

import {collect} from toolmanage        //引入‘collect’

collect.monitor.server = 'http://192.168.1.145:5000' //调用该方法先传入server
collect.monitor.collect(app, device, content) //调用方法,并传入对应参数

# storage(local,session==>storage应用)

import {storage} from toolmanage        //引入‘storage’

storage.driver(str) //调用该方法入参str:local/session;决定localStorage/sessionStorage

storage.set(key,val) //同setItem
storage.get(key) //同getItem
storage.remove(key) //同removeItem
storage.clear()  //同clear

# validate
import {validate} from toolmanage //引入validate

var model={
    isUsed:true,
    telphone:'18782924967'
}
var validatorConfig={
    required:true,
    preCondition:function(model){
        return model.isUsed
    },
    description:'手机号码不能为空',
    regExp:'/^1[34578]\d{9}$/',
    regExpMsg:'手机号码格式不正确'
}//model是需要验证的对象,validatorConfig为验证配置

var result=validate(model,validatorConfig)  //model 验证对象,validatorConfig为配置的验证条件


{
 status:false,
 msg:rule.regExpMsg
}//result数据结构
3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago