Skip to content

spencertipping/caterwaul-serialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mediocre serialization for Javascript.
This library is basically a port of Rather Insane Serialization to Caterwaul.
It serializes things using stateful streams, which construct references for
opaque objects and can later resolve those references. For example:

d = document.createElement('div')
stream = caterwaul.serialization()
s = stream({dom_node: d})
decoded = stream.decode(s)
decoded.dom_node === d          // returns true

It uses this technique when encoding objects whose prototypes are unknown.

NOTE! This library doesn't serialize directly to strings. Instead, it produces
JSON objects that you can serialize using any JSON library (or convert them to
XML, or whatever). It's implemented this way (1) because I'm lazy, and (2)
because a native JSON implementation is probably faster than anything I would
be willing to implement here.

About

A serialization library that supports abstract values

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published