lawnchair – a client side JSON document store

Sorta like a couch except smaller and outside

JSON Daten clientseitig speichern und verfügbar halten.

“stores” nennt Lawnchair das dann.
Eigentlich ähnlich wie bei Propel und co. Nur halt ohne DB.

ich würde sagen die Syntax spricht in dem Fall für sich selbst:

var people = new Lawnchair('people');



// Saving a document
var me = {name:'brian'};
people.save(me);
 
 
// Saving a document async
people.save({name:'frank'}, function(r) {
    console.log(r);
});
 
 
// Specifying your own key
people.save({key:'whatever', name:'dracula'});



// Get that document
people.get(me.key, function(r){
    console.log(r);
});
 
 
// Returns all documents as an array to a callback
people.all(function(r){
    console.log(r);
});
 
 
// List all with shortcut syntax
people.all('console.log(r)');



// Remove a document directly
people.get(me.key, function(r){
    people.remove(me);
});
 
// Remove a document by key
people.save({key:'die', name:'duder'});
people.remove('die');
 
// Destroy all documents
people.nuke();



3 Replies to “lawnchair – a client side JSON document store”

  1. der hier macht auch sowas:
    http://pablotron.org/?cid=1557

    da gibts auch ein paar erklärende worte:

    Currently the only reliable cross-platform and cross-browser mechanism for storing data on the client side are cookies. Unfortunately, using cookies to store persistent data has several problems:

    Size: Cookies are limited to about 4 kilobytes in size.
    Bandwidth: Cookies are sent along with every HTTP transaction.
    Complexity: Cookies are difficult to manipulate correctly.

    Modern web browsers have addressed these issues by adding non-Cookie mechanisms for saving client-side persistent data. Each of these solutions are simpler to use than cookies, can store far more data, and are not transmitted along with HTTP requests. Unfortunately, each browser has addressed the problem in a different and incompatible way

  2. yap persistentJS ist ebenfalls ein abstractionLayer für die ganzen storage ansätze
    lawnchair wahrscheinlich auch.

    lass es uns wissen, wenn du das erfolgreich eingesetzt hast

Comments are closed.