diff --git a/README.md b/README.md index 54ff0e4..5ab3c4b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # form-validation [![Build Status](https://travis-ci.org/tigercosmos/date2obj.svg?branch=master)](https://travis-ci.org/tigercosmos/date2obj) -[![npm version](https://badge.fury.io/js/date2obj.svg)](https://badge.fury.io/js/date2obj) +[![npm version](https://badge.fury.io/js/%40yutangshi%2Fform-validation.svg)](https://badge.fury.io/js/date2obj) [![npm](https://img.shields.io/npm/dt/date2obj.svg?style=flat-square)](https://www.npmjs.com/package/date2obj) [![Greenkeeper badge](https://badges.greenkeeper.io/tigercosmos/date2obj.svg)](https://greenkeeper.io/) @@ -14,12 +14,23 @@ npm i form-validation --save ``` ```js -var dataValid new dataValidation() // Get validate object -const res = form.userName("Allen"); -console.log('姓名驗證:' + JSON.stringify(res)) -assert.deepEqual( - res, { status: 200, message: "" } -) +const form = new formValidation(); // Get validate object + +const res = form.userName("Allen"); // Validate user name input. +// response format +// { +// status: 200, +// message: "" +// } + +const res = form.mobile("Allen"); // Validate mobile input. +// response format +// { +// status: 512, +// message: "您輸入的手機格式不正確。" +// } + + ``` diff --git a/package.json b/package.json index a76a845..9499ac0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "form-validation", + "name": "@yutangshi/form-validation", "version": "1.0.1", "description": "Validate each field data format in JavaScript ", "main": "index.js", @@ -22,5 +22,6 @@ "homepage": "https://github.com/YutangShi/form-validation", "devDependencies": { "assert": "^1.4.1" - } -} + }, + "dependencies": {} +} \ No newline at end of file