From ed46a8a3642a71b6b41a22436b068ff25d7aa480 Mon Sep 17 00:00:00 2001 From: lancegin Date: Wed, 28 Jun 2017 17:15:37 +0800 Subject: [PATCH] upd: README --- README.md | 37 +++++++++++++++++++++++++++++++------ docs/README_zh.md | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8fac1db..0b8baba 100644 --- a/README.md +++ b/README.md @@ -15,25 +15,35 @@ The module was implement based on [RFC4226](https://tools.ietf.org/html/rfc4226) ### Installation - npm install jsotp +```shell +npm install jsotp +``` ### Module -All features support: +All modules support: - let jsotp = require('jsotp'); +```javascript +let jsotp = require('jsotp'); +``` Only `Base32` module support: - let jsotp = require('jsotp/base32'); +```javascript +let jsotp = require('jsotp/base32'); +``` Only `HOTP` module support: - let jsotp = require('jsotp/hotp'); +```javascript +let jsotp = require('jsotp/hotp'); +``` Only `TOTP` module support: - let jsotp = require('jsotp/totp'); +```javascript +let jsotp = require('jsotp/totp'); +``` ### Usage @@ -99,5 +109,20 @@ let b32_secret = jsotp.Base32.random_gen(); #### • jsotp.HOTP.verify() +### Develop + +* Clone depo and install dependencies + +```shell +git clone git@github.com:LanceGin/jsotp.git +npm install +``` + +* Contribute the code in `src/`, and run command below to build the es6 code to es2015. That will create a local directory named `lib/`. + +```shell +npm run build +``` + ### [中文文档](docs/README_zh.md) diff --git a/docs/README_zh.md b/docs/README_zh.md index 3ed2a38..aa6a0b5 100644 --- a/docs/README_zh.md +++ b/docs/README_zh.md @@ -15,25 +15,35 @@ ### 安装 - npm install jsotp +```shell +npm install jsotp +``` ### 模块 全部模块支持: - let jsotp = require('jsotp'); +```javascript +let jsotp = require('jsotp'); +``` 仅 `Base32` 模块支持: - let jsotp = require('jsotp/base32'); +```javascript +let jsotp = require('jsotp/base32'); +``` 仅 `HOTP` 模块支持: - let jsotp = require('jsotp/hotp'); +```javascript +let jsotp = require('jsotp/hotp'); +``` 仅 `TOTP` 模块支持: - let jsotp = require('jsotp/totp'); +```javascript +let jsotp = require('jsotp/totp'); +``` ### 使用 @@ -99,4 +109,19 @@ let b32_secret = jsotp.Base32.random_gen(); #### • jsotp.HOTP.verify() +### 开发 + +* 克隆代码并安装依赖 + +```shell +git clone git@github.com:LanceGin/jsotp.git +npm install +``` + +* 在`src/`文件夹中进行源码编写,执行下面命令将es6代码编译成es2015,命令会生成一个`lib/`本地文件夹。 + +```shell +npm run build +``` + ### [README](../README.md) \ No newline at end of file