🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

jce

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jce

JCE reader and writer for JavaScript

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
22
2100%
Maintainers
1
Weekly downloads
 
Created
Source

jce

一种自解释型的 TTLV<Tag,Type,Length,Value> 数据交换协议

Install with npm:

# npm i jce

Example:

const jce = require("jce");

const struct = {
    foo: 0, //tag0
    bar: 1, //tag1
    baz: 2  //tag2
};
const object = {
    foo: 12.34,
    bar: "bar123",
    baz: {
        qaz: [Buffer.from("abcdef"), 12n]
    }
};
const encoded = jce.encode(object, struct);
const decoded = jce.decode(encoded, struct);

console.log(encoded);
console.log(decoded);

Nesting Usage:
test.js

Keywords

jce-protocol

FAQs

Package last updated on 18 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts