You can not 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 a4cfb73327 📝 Update README 12 minutes ago
lib Add 'modify' support for Node 2 weeks ago
src 💡 Add JSDoc 20 hours ago
.gitignore 🎉 Initial commit 3 weeks ago
README.md 📝 Update README 12 minutes ago
mod.js 🎨 Add runtime exports 21 hours ago
package.json Add 'modify' support for Node 2 weeks ago
yarn.lock Add 'modify' support for Node 2 weeks ago

README.md

XeDB

Cross-runtime embedded database for JavaScript.

Usage

Storage runtimes

From Deno

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

From Node

import {
    createDatastore,
    nodeRuntime
} from 'xedb.js';
const datastore = createDatastore({
    runtime: nodeRuntime
});

From browser

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

In-memory runtimes

Using storage runtimes examples, replace the runtime import with :

  • inMemoryDenoOrBrowserRuntime for Deno or browser ;
  • inMemoryNodeRuntime for Node.

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.