Git Product home page Git Product logo

loki-msgpack-adapter's Introduction

loki-msgpack-adapter

A simple lokijs "proxy" adapter using msgpack-lite to serialize the database.

Usage

npm i --save loki-msgpack-adapter

// Should work with all normal (not reference) mode persistenceAdapters
var myAdapter = new myPersistenceAdapter(/*...*/);
// if you don't pass an adapter we will try to use lokijs fs adapter
var proxy = new lokiMsgpackAdapter({adapter: myAdapter});

var db = new loki('test.db', {adapter: proxy /* ... */});
/* use your db as normal */
// ...
db.saveDatabase();
// Your adapter saved the db in the messagepack format

In browser just drop in lokijs and msgpack-lite and your are ready to go.

In node loki-msgpack will require the dependencies itself.

If you are using something like browserify or webpack all should work fine :).

Having questions ? Found a bug ? Need a feature ?

Just open an issue here or even better a pull request.

I'd love to see contibution.

Thanks to

  • @techfort and all lokijs contributors for building and maintaining lokijs
  • @kawanet and all msgpack-lite contributors for building and maintaining msgpack-lite.

These are awesome projects.

loki-msgpack-adapter's People

Contributors

kanaye avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.