Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/continuous-storage
Store a continuous ndarray in a level.js/levelup database.
https://github.com/hughsk/continuous-storage
Last synced: 12 days ago
JSON representation
Store a continuous ndarray in a level.js/levelup database.
- Host: GitHub
- URL: https://github.com/hughsk/continuous-storage
- Owner: hughsk
- License: other
- Created: 2013-07-18T23:45:07.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-19T04:12:51.000Z (about 11 years ago)
- Last Synced: 2024-10-17T16:41:21.116Z (22 days ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# continuous-storage [![experimental](https://rawgithub.com/hughsk/stability-badges/master/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Store a continuous ndarray in a [level](http://github.com/level) database -
using either [levelup](http://github.com/rvagg) with Node or
[level.js](http://github.com/maxogden/level.js) in the browser.Example incoming in the
[topdown-physics demo](http://hughsk.github.io/topdown-physics).## Installation ##
``` bash
npm install continuous-storage
```## Usage ##
### `store = storage(db, field[, options])` ###
Creates a store instance for your database and continuous array:
* `db` is a [level](http://github.com/level) database.
* `field` is the continuous ndarray you want to store.With the following options:
* `options.index` is a function which maps a position array to a
string key for each chunk in the database. Defaults to
`position.join(':')`.### `store.saveall()` ###
Saves all of the currently instantiated chunks to the database.
### `store.save(chunk)` ###
Saves a chunk to the database.