All Projects → Level → Memdown

Level / Memdown

Licence: other
In-memory abstract-leveldown store for Node.js and browsers.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Memdown

Levelup
A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.
Stars: ✭ 3,960 (+1428.96%)
Mutual labels:  level, browser
Level Js
An abstract-leveldown compliant store on top of IndexedDB.
Stars: ✭ 485 (+87.26%)
Mutual labels:  level, browser
Level Browserify
No longer maintained: superseded by level v5.0.0.
Stars: ✭ 64 (-75.29%)
Mutual labels:  level, browser
blender-xray
STALKER (aka xray-engine) import/export plugin for Blender 3D
Stars: ✭ 132 (-49.03%)
Mutual labels:  level
game-map-editor
game-map-editor
Stars: ✭ 17 (-93.44%)
Mutual labels:  level
next-level-week-clone
🧬a clone of the Next Level Week website made with reactjs using typescript
Stars: ✭ 13 (-94.98%)
Mutual labels:  level
mem
A convenience package bundling levelup and memdown.
Stars: ✭ 23 (-91.12%)
Mutual labels:  level
Awesome
An open list of awesome Level modules and resources.
Stars: ✭ 204 (-21.24%)
Mutual labels:  level
level-test
Inject temporary and isolated level stores (leveldown, level-js, memdown or custom) into your tests.
Stars: ✭ 19 (-92.66%)
Mutual labels:  level
HorizontalAndCircleTimeView
自定义水平刻度尺和圆形钟表刻度 可点击 可拖动 刻度 水平刻度划分为60份 圆形刻度划分为24份 可自定义修改
Stars: ✭ 14 (-94.59%)
Mutual labels:  level
encrypt-down
An abstract-leveldown implementation that wraps another store to encrypt the stored values.
Stars: ✭ 16 (-93.82%)
Mutual labels:  level
aarbac
An Automated Role Based Access Control .NET framework with T-SQL Query Parser which automatically parse select, insert, update, delete queries based on the logged in user role
Stars: ✭ 18 (-93.05%)
Mutual labels:  level
packager
A levelup package helper for distributing with an abstract-leveldown compatible back-end.
Stars: ✭ 20 (-92.28%)
Mutual labels:  level
codec
Encode keys, values and range options, with built-in or custom encodings.
Stars: ✭ 27 (-89.58%)
Mutual labels:  level
batify
Only one udevrule file triggering plug and critical battery level notifications (multi-x sessions support)
Stars: ✭ 47 (-81.85%)
Mutual labels:  level
advanced-level-editor
Advanced, but simple to use, runtime level editor for Unity.
Stars: ✭ 64 (-75.29%)
Mutual labels:  level
deferred-leveldown
An abstract-leveldown implementation that queues operations while a real abstract-leveldown instance is being opened.
Stars: ✭ 18 (-93.05%)
Mutual labels:  level
level-ws
A basic writable stream for abstract-level databases.
Stars: ✭ 19 (-92.66%)
Mutual labels:  level
tevere
🏞 Decentralized DB over IPFS
Stars: ✭ 57 (-77.99%)
Mutual labels:  level
discord-level-bot
A simple Discord level bot.
Stars: ✭ 49 (-81.08%)
Mutual labels:  level

memdown

In-memory abstract-leveldown store for Node.js and browsers.

level badge npm Node version Travis Coverage Status JavaScript Style Guide npm Backers on Open Collective Sponsors on Open Collective

Example

If you are upgrading: please see the upgrade guide.

const levelup = require('levelup')
const memdown = require('memdown')

const db = levelup(memdown())

db.put('hey', 'you', (err) => {
  if (err) throw err

  db.get('hey', { asBuffer: false }, (err, value) => {
    if (err) throw err
    console.log(value) // 'you'
  })
})

Your data is discarded when the process ends or you release a reference to the store. Note as well, though the internals of memdown operate synchronously - levelup does not.

Browser support

Sauce Test Status

Data types

Keys and values can be strings or Buffers. Any other key type will be irreversibly stringified. The only exceptions are null and undefined. Keys and values of that type are rejected.

const db = levelup(memdown())

db.put('example', 123, (err) => {
  if (err) throw err

  db.createReadStream({
    keyAsBuffer: false,
    valueAsBuffer: false
  }).on('data', (entry) => {
    console.log(typeof entry.key) // 'string'
    console.log(typeof entry.value) // 'string'
  })
})

If you desire non-destructive encoding (e.g. to store and retrieve numbers as-is), wrap memdown with encoding-down. Alternatively install level-mem which conveniently bundles levelup, memdown and encoding-down. Such an approach is also recommended if you want to achieve universal (isomorphic) behavior. For example, you could have leveldown in a backend and memdown in the frontend.

const encode = require('encoding-down')
const db = levelup(encode(memdown(), { valueEncoding: 'json' }))

db.put('example', 123, (err) => {
  if (err) throw err

  db.createReadStream({
    keyAsBuffer: false,
    valueAsBuffer: false
  }).on('data', (entry) => {
    console.log(typeof entry.key) // 'string'
    console.log(typeof entry.value) // 'number'
  })
})

Snapshot guarantees

A memdown store is backed by a fully persistent data structure and thus has snapshot guarantees. Meaning that reads operate on a snapshot in time, unaffected by simultaneous writes.

Test

In addition to the regular npm test, you can test memdown in a browser of choice with:

npm run test-browser-local

To check code coverage:

npm run coverage

Contributing

Level/memdown is an OPEN Open Source Project. This means that:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the Contribution Guide for more details.

Big Thanks

Cross-browser Testing Platform and Open Source ♥ Provided by Sauce Labs.

Sauce Labs logo

Donate

To sustain Level and its activities, become a backer or sponsor on Open Collective. Your logo or avatar will be displayed on our 28+ GitHub repositories and npm packages. 💖

Backers

Open Collective backers

Sponsors

Open Collective sponsors

License

MIT © 2013-present Rod Vagg and Contributors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].