node package manager

jade-serial

Jade serialization module

Jade Serial

Adds serialization / deserialization capabilities to Jade nodes.

Example

var serial = require('jade-serial')
  , serialize = serial.serialize
  , deserialize = serial.deserialize;

// serialize and store in your database (eg: from the compiler)

storeInDatabase(JSON.stringify(serialize(node)));

// deserialize

var node = deserialize(JSON.parse(jsonRepresentation));
console.log(node.name);
console.log(node.attrs);

Credits

Guillermo Rauch <guillermo@learnboost.com>