node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป



Permafrost uses harmony proxies to recursively trap updates to data structures and store the changing structures to disk automatically and transparently to the programming model.

Think ORM, but with a crazy low impedance mismatch.

This thing is still quite buggy. I wouldn't use it for anything important yet.



var pf = require('permafrost');

pf('times.db', { times : 0 }, function (err, obj) {
    obj.times ++;
    console.log(obj.times + ' times');

And then run it: $ node times.js 1 times $ node times.js 2 times $ node times.js 3 times

Amazing! You can modify references too:


var pf = require('permafrost');

pf('push.db', [], function (err, xs) {
    var n = Math.floor(Math.random() * 256);

Then run it repeatedly: $ node push.js [ 109 ] $ node push.js [ 109, 9 ] $ node push.js [ 109, 9, 33 ]

Super great. You can modify nested references too:


var pf = require('permafrost');

pf('moo.db', {}, function (err, moo) {
    moo.xs = [3,4,5];
    moo.xs.push({ a : 1, b : 2, c : [3,4,5] });

Which prints: { xs: [ 3, 4, 5, 6, { a: 1, b: 2, c: [Object] } ] }


pf(db, cb)

pf(db, def, cb)

Get a handle to the top-layer object in the provided callback.

If db is a string, a it's treated as the filename of a supermarket database. Otherwise db is treated as a key/value store and is expected to have .get(), .set(), .remove(), and .all().

If def is supplied and there is no existing data in the database, permafrost will return def to the inner callback instead.

When the data store is ready, cb(err, obj) is called with the wrapped object or an error message. The data store is updated immediately when obj changes.


With npm, just do: npm install permafrost

or clone this project on github:

git clone

To run the tests with expresso, just do:



When you npm install permafrost these dependencies will be automatically installed.