Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jpacks

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpacks - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

4

jpacks.dev.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc