bytepack-encode
v0.1.0
Published
Fixed-size binary encoding for AI agent communication. 20x more compact than JSON.
Maintainers
Readme
bytepack-encode
Fixed-size binary encoding for AI agent communication. 20x more compact than JSON.
Install
npm install bytepack-encodeUsage
const { encode, decode, health } = require('bytepack-encode');
// Encode any structured data → fixed 2,556 bytes
const result = await encode({
action: 'observe',
domain: 'market',
asset: 'BTC',
confidence: 'high',
});
console.log(`${result.s} bytes`); // 2556
// Decode back
const data = await decode(result.b64);API
encode(data, options?)
Encode structured data into fixed-size binary.
decode(binaryB64, options?)
Decode base64 binary back to structured data.
health(options?)
Check service status.
Options
url— Override service URL (default:BYTEPACK_URLenv orhttps://sutr.lol)timeout— Request timeout in ms (default: 10000)
Benchmarks
| Metric | JSON | bytepack | |--------|------|----------| | Size | 5,000-50,000 bytes | 2,556 bytes | | Fixed size? | No | Yes | | Transport | Text | Any |
License
MIT
