You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
KaKi87 01e8cac678 ♻️ 'rawcdn.githack.com' -> 'cdn.jsdelivr.net' 4 weeks ago
lib ♻️ 'rawcdn.githack.com' -> 'cdn.jsdelivr.net' 4 weeks ago
src 💡 Add JSDoc 4 months ago
.gitignore 🎉 Initial commit 5 months ago
README.md ♻️ 'jspm.dev'/'esm.sh' -> 'npm:' 3 months ago
mod.js Revert 1b0b0519 3 months ago
package.json 🔖 Initial release 4 months ago
yarn.lock Add 'modify' support for Node 4 months ago

README.md

XeDB

Cross-runtime embedded database for JavaScript.

Usage

Storage runtimes

From Deno

import {
    createDatastore
} from 'https://git.kaki87.net/KaKi87/xedb/raw/branch/master/mod.js';
import deno from 'https://git.kaki87.net/KaKi87/xedb/raw/branch/master/lib/deno.js';
const datastore = createDatastore({
    runtime: deno
});

From Node

import {
    createDatastore
} from 'xedb.js';
import node from 'xedb.js/lib/node.js';
const datastore = createDatastore({
    runtime: node
});

From browser

<script type="module">
    import {
        createDatastore
    } from 'https://raw.githack.com/KaKi87-2/xedb/master/mod.js';
    import browser from 'https://raw.githack.com/KaKi87-2/xedb/master/lib/browser.js';
    const datastore = createDatastore({
        runtime: browser
    });
</script>

In-memory runtimes

Using storage runtimes examples, replace the runtime import with :

  • inMemory.deno.js for Deno ;
  • inMemory.node.js for Node ;
  • inMemory.browser.js for browser.

API

Most MongoDB methods as well as query operators (thanks to crcn/sift.js) and update operators (thanks to seald/nedb/lib/model) are supported.

Serializers

The createDatastore method takes a serializer parameter containing serialize and deserialize methods (JSON by default).

DSV support is planned.