Giter VIP home page Giter VIP logo

xen.db's Introduction

Xen.db

downloadsBadge versionBadge docs

Xen.db is an open-sourced SQLite3 Database designed to be easy-to-use and beginner friendly. This Database access and store various of data persistently via BetterSQLite3.

Features

  • Powerful - Supports Non-Xen.db Method.
  • Customizable - More Utility Method.
  • Family-Friendly - Simple & Easy-To-Use For Beginners.
  • 100% Based - Key Value Based.
  • Persistent Database - Value Will Not Lost When On Retstarting Session.
  • Free-To-Use - Not Needed To Set Up A SQL Database Server! All Data Is Stored Locally In The Same Project.
  • Custom Database File - Xen.db Allow Users To Create Custom Database File And Its Path!

Example (Default)

Coding A Sandbox (Demo)

const { Database } = require("xen.db");
const db = new Database(); 

// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' });
// -> { difficulty: 'Easy' }
 
// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword');
// -> { difficulty: 'Easy', items: ['Sword'] }
 
// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500);
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
 
// Repeating previous examples:
db.push('userInfo.items', 'Watch');
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500);
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
 
// Fetching individual properties
db.get('userInfo.balance'); // -> 1000
db.get('userInfo.items'); // ['Sword', 'Watch']

Example (Custom)

const { Database } = require("xen.db");
const db = new Database("Database/xen.db", { path: "Database", table: "JSON"});
// Creates a Database File called "xen.db" inside a "Database" folder instead of "json.sqlite"

// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' });
// -> { difficulty: 'Easy' }
 
// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword');
// -> { difficulty: 'Easy', items: ['Sword'] }
 
// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500);
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
 
// Repeating previous examples:
db.push('userInfo.items', 'Watch');
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500);
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
 
// Fetching individual properties
db.get('userInfo.balance'); // -> 1000
db.get('userInfo.items'); // ['Sword', 'Watch']

Creating A Table

// Creates New Table
const table = db.createTable("MyTable");

db.set("Inv", "Sword");
table.set("Inv", "Diamond");

db.get("Inv");
// -> Sword

table.get("Inv");
// -> Diamond

List All Tables

const tables = db.tables();

console.log(tables);

Why Xen.db?

  • Lightweight
  • Consistent
  • Easy-To-Use
  • Customizable
  • Key & Value Based
  • Persistent Database

We've Over 2,000+ Downloads On NPM!

Check Out Our GitHub For Contributions!


Installation

If You Have Trouble Installing Xen.db. Please Follow This Troubleshooting Guide.

Windows Platform
  1. Open: Any Terminal (Eg. PowerShell, Command Prompt)
  2. Run: npm i xen.db
  • If you want to be more updated, you can install the dev version instead: npm i NotMarx/xen.db#dev

Note: Windows Users Might Need To Do The Following Additional Steps.

Mac Platform
  1. Install: XCode
  2. Run: npm i -g node-gyp In Your Console Or Terminal
  3. Run: node-gyp --python /path/to/python2.7
  4. Finally, Run: npm i xen.db

Documentation


xen.db's People

Contributors

hary1723 avatar reinacchi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.