OnionSkin is multi-layer cache manager library that works with Node.js and vanilla javascript
You can either install via npm
$ npm install onionskin
Or via bower
$ bower install onionskin
Or you can just grab a copy of it here
// Library is exposed on the browser with browserify for API consistency with node.js
var OnionSkin = require('onionskin');
// Initialize a pool
var pool = new OnionSkin();
pool.get('my/key/path').catch(function (err) {
// Data is either inexistent or expired
return slowFuncThatReturnsPromise().then(this.save);
});
You can find more usage examples at the website's Getting Started section Also there is the API Documentation
You can:
- Talk to me at @onionskinjs
- Ask a question at StackOverflow
- Send me an email at contact@onionskin.io
So you decided you want to help... This is awesome!!! Follow this steps and I will be really glad to merge your work and add you to the contributors!
-
Fork the project
-
Clone it and create a branch with the name of the feature you intend to add
$ git clone git@github.com:username/onionskin.git $ git checkout -b new-feature-name
-
Install the dependencies
$ bower install # for browser tests $ npm install # for node.js tests
-
Please add tests to your features.
- Tests run with Mocha and use Chai for expectations.
- Expect is preferred to should due to browser compatibility
- The test folder respect the same structure as the source, you can run the tests through npm:
$ npm test
or run specific tests with mocha:
mocha test/stash/drivers/*.js
you also can run the tests on browser
open test/index.html
-
Send me a pull request
- WebSQL, Cassandra, MongoDB [, ... ] drivers
- Benchmarks
- More examples
This project was created by @tadeuzagallo inspired by a PHP library named Stash and was originally Stash.js. If you want to join just follow the instructions, any help will be very welcome.