Skip to content
Thin wrapper about Loki and the Loki NativeScript adapter
JavaScript TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
nativescript-loki.js
nativescript-loki.ts
package.json
tsconfig.json

README.md

NativeScript Loki

Thin wrapper around Loki and Loki NativeScript adapter

What is Loki

LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. - LokiJS

Installation

Run the following command from the /app directory of your project:

$ npm install nativescript-loki --save

Usage

// Requirements
var Loki = require("./node_modules/nativescript-loki/nativescript-loki.js");

// Setup Loki
var db = new Loki("loki", { autosave: true });

// Check if database exists
if(db.exists()) {
    console.log("Database exists");
}

// Rename database
db.rename("new-name").then(function() {
    console.log("Database renamed");
});

// Remove database
db.remove().then(function() {
    console.log("Database removed");
});

Thanks

The thanks goes to sect2k who has inspired me to create this package.

To go deeper in Loki have a look at the documentation.

npm version

You can’t perform that action at this time.