https://github.com/grimen/node-document-storage
Storage adapter interface for `node-document` ODM for Node.js.
https://github.com/grimen/node-document-storage
Last synced: 3 months ago
JSON representation
Storage adapter interface for `node-document` ODM for Node.js.
- Host: GitHub
- URL: https://github.com/grimen/node-document-storage
- Owner: grimen
- License: mit
- Created: 2013-01-04T22:35:23.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-29T09:04:25.000Z (over 11 years ago)
- Last Synced: 2025-02-12T07:53:56.470Z (3 months ago)
- Language: JavaScript
- Homepage: https://npmjs.org/package/node-document-storage
- Size: 271 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# NODE-DOCUMENT-STORAGE [](http://travis-ci.org/grimen/node-document-storage)
**Storage** adapter interface for [node-document](https://github.com/grimen/node-document) ODM for Node.js.
## About
Unified interface for write/read data to/from differen kinds of storages/databases.
## Adapters
* [Global](https://github.com/grimen/node-document-storage-global) *Memory*
* [FS](https://github.com/grimen/node-document-storage-fs) *FileSystem*
* [NStore](https://github.com/grimen/node-document-storage-nstore) *Memory/File/Process*
* [Memcached](https://github.com/grimen/node-document-storage-memcached)
* [Redis](https://github.com/grimen/node-document-storage-redis)
* [KyotoCabinet](https://github.com/grimen/node-document-storage-kyotocabinet)
* [MongoDB](https://github.com/grimen/node-document-storage-mongodb)
* [CouchDB](https://github.com/grimen/node-document-storage-couchdb)
* [Riak](https://github.com/grimen/node-document-storage-riak)
* [ElasticSearch](https://github.com/grimen/node-document-storage-elasticsearch)
* [AmazonS3](https://github.com/grimen/node-document-storage-amazons3)## API
### `#set`
* `(keys, values, [callback(err, res)])`
```javascript
storage.set(['post/1', 'post/2'], [{foo: 1}, {foo: 2}], function(err, res) {
// console.log(arguments);
});
```* `(keys_values, [callback(err, res)])`
```javascript
storage.set({'post/1': {foo: 1}, 'post/2': {foo: 1}}, function(err, res) {
// console.log(arguments);
});
```### `#get`
* `(keys, [callback(err, res)])`
```javascript
storage.get(['post/1', 'post/2'], function(err, res) {
// console.log(arguments);
});
```### `#del`
* `(keys, [callback(err, res)])`
```javascript
storage.del(['post/1', 'post/2'], function(err, res) {
// console.log(arguments);
});
```### `#exists`
* `(keys, [callback(err, res)])`
```javascript
storage.exists(['post/1', 'post/2'], function(err, res) {
// console.log(arguments);
});
```## Installation
```shell
$ npm install node-document-storage
```## Test
**Local tests:**
```shell
$ make test
```## License
Released under the MIT license.
Copyright (c) [Jonas Grimfelt](http://github.com/grimen)
[](https://bitdeli.com/free "Bitdeli Badge")