Registry / security / zser
library0.0.1jsnpmunverified

zser is a security-oriented serialization format with novel authentication properties based on Merkleized data structures. The JavaScript/TypeScript implementation (version 0.0.1) targets ES2017+ and provides parsing and serialization APIs. It is currently in early development with no recent updates. The library ships TypeScript types and is designed for use cases requiring authenticated data serialization, such as credential and token handling.

npm install zser
INSTALL
IMPORT
SIG · ZSER
Z
zser
securityjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import zser from 'zser'
const zser = require('zser')
ESM-only; CommonJS require is not supported.
Zser
import { Zser } from 'zser'
Named export for the main class.
ParseOptions
import type { ParseOptions } from 'zser'
Type import for TypeScript users.

Parses a Uint8Array into an object and serializes an object back to Uint8Array, with hex encoding/decoding.

import zser from 'zser'; import { Buffer } from 'node:buffer'; // Assume we have a Uint8Array containing a serialized zser message const message = new Uint8Array([0x15, 0x07, 0x02, 0x03, 0x55]); // Parse the message const parsed = zser.parse(message); console.log(parsed); // { '1': { '24': 42 } } // Serialize an object const obj = { foo: { bar: [1, 2, 3] } }; const serialized = zser.serialize(obj); console.log(serialized); // Uint8Array // Encode/decode to/from hex string const hex = zser.encode(serialized); console.log(hex); // hex string const decoded = zser.decode(hex); console.log(decoded); // Uint8Array
Debug
Known issues
breakingThis library is targeting ES2017 and may require transpilation for older environments.
fix
Use a transpiler like Babel with ES2017 preset, or upgrade your runtime.
affects: >=0.0.0
gotchaThe library is in early development (v0.0.1) and the API may change without notice.
fix
Pin to a specific version and test thoroughly before upgrading.
affects: >=0.0.0
gotchaThe default export is zser, but there is also a named export Zser. Depending on the bundler, import { Zser } may yield undefined if only default is provided.
fix
Use default import unless you are sure your bundler handles both.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: zser.parse is not a function
Misunderstanding of import: using named import where default import is needed.
fix
Change import { zser } from 'zser' to import zser from 'zser'.
SyntaxError: Unexpected token 'export'
Using CommonJS require() on an ESModule package.
fix
Switch to ES module imports: import zser from 'zser'.
ReferenceError: Buffer is not defined
Browser environment missing Node.js Buffer.
fix
Use Uint8Array directly instead of Buffer, or include a polyfill.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
1
Resources
packagezser
zser — npm install zser · libregistry