Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A buffered, flatfile serializer for node.js

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 README
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README
Spirit is a fast, lightweight text-driven database. Geared for prototypes, with easy replacement, and for small projects.

Usage:

var spirit = require('spirit');

..Network data..e.g. get('/something/:id'), function(req, res) {
  var id = req.param.id;
  spirit.openDatafile('something/ids.dat', 'id', id, function(data) {
    //Use your data, e.g. res.render('userpage', { username: data.username });
  });
  
  var userDataWouldBeNice;
  //same code as before, mostly
  spirit.openDatafile('something/ids.dat', 'id', id, function(err, data) {
    if (err) console.log(err);
    userDataWouldBeNice = data;
  });
  
  userDataWouldBeNice.powerlevel++;
  
  spirit.saveDatafile('something/ids.dat', 'id', id, userDataWouldBeNice, function(err) {
    if (err) console.log(err);
  });
  
Something went wrong with that request. Please try again.