Comparing version 0.6.2 to 0.6.3
@@ -8,4 +8,4 @@ (function (exportName) { | ||
* zswang (http://weibo.com/zswang) | ||
* @version 0.6.2 | ||
* @date 2015-11-15 | ||
* @version 0.6.3 | ||
* @date 2016-02-29 | ||
*/ | ||
@@ -12,0 +12,0 @@ function createSchema() { |
@@ -8,4 +8,4 @@ (function (exportName) { | ||
* zswang (http://weibo.com/zswang) | ||
* @version 0.6.2 | ||
* @date 2015-11-15 | ||
* @version 0.6.3 | ||
* @date 2016-02-29 | ||
*/ | ||
@@ -12,0 +12,0 @@ function createSchema() { |
@@ -5,3 +5,3 @@ { | ||
"description": "Binary data packing and unpacking.", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"homepage": "http://github.com/zswang/jpacks", | ||
@@ -20,5 +20,10 @@ "main": "jpacks.js", | ||
"struct", | ||
"serialization", | ||
"serialize", | ||
"pack", | ||
"unpack" | ||
"unpack", | ||
"binary", | ||
"parse", | ||
"structure", | ||
"packets", | ||
"schema" | ||
], | ||
@@ -25,0 +30,0 @@ "bugs": { |
@@ -14,3 +14,4 @@ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url] | ||
```js | ||
jpacks.register('User', { | ||
// 定义结构 | ||
jpacks.def('User', { | ||
age: 'uint8', | ||
@@ -22,2 +23,3 @@ token: jpacks.array('byte', 10), | ||
}); | ||
var user = { | ||
@@ -48,8 +50,13 @@ age: 6, | ||
}; | ||
// 组包 | ||
var buffer = jpacks.pack('User', user); | ||
// 解包 | ||
var user2 = jpacks.unpack('User', buffer); | ||
console.log(JSON.stringify(user2, null, ' ')); | ||
``` | ||
## feature | ||
## Features 功能性 | ||
@@ -60,5 +67,13 @@ + Supports running in NodeJS and Browser. 支持运行在 NodeJS 和浏览器环境。 | ||
+ Supports array types, including fixed length or indefinite. 支持数组类型,包括定长或不定长。 | ||
+ Int64. 大整数处理。 | ||
+ Protocol Buffers. 支持处理 PB 协议。 | ||
+ Data compression and decompression. 数据压缩和解压。 | ||
## License | ||
## Dependencies 依赖 | ||
+ [protobufjs](https://github.com/dcodeIO/protobuf.js) | ||
+ [long](https://github.com/dcodeIO/long.js) | ||
## License 许可协议 | ||
MIT © [zswang](http://weibo.com/zswang) | ||
@@ -65,0 +80,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110866
83