Ninety-nine Pitchers of Malt

    luma-db

    1.1.0 • Public • Published

    ℹ️⎞ About

    Luma Package it's a unique package made by Jeotique that allows you to create online database...

    NPM info


    📥⎟ Installation

    Open your application's terminal and type:

    $ npm install luma-db
    

    ➡️⎟ Usage

    How to use :

    First step you need to declare your tables (yes before the database.) :

    const {Table} = require('luma-db')
    const table1 = new Table("table1") //in option you need to put the table name
    const table2 = new Table("table2")

    After that you can declare your database :

    const {Database} = require('luma-db')
    const myDb = new Database({
        name: "my_new_database", //this is the name of the database, if the database name is already used you will get an error.
        password: "myStrongPass", //this is the password of the database
        tables: [table1, table2] //here you put your table
    })

    And now you are ready to use your new database system :

    table1.set('message', 'hello world').save()
    console.log(table1.get('message')) //hello world

    All functions :

    <table>.has('key') //will return true if the key exist in the table and false if not
    <table>.get('key') //will return the value where the key is 'key' or undefined if doesn't exist
    <table>.get('key', true, 'hello i am a key') //will return the value where the key is 'key' or if the key doesn't exist she will be created with the value 'hello i am a key'
    <table>.set('key', 'im always a key') //will set the value 'im always a key' where key is 'key'
    <table>.tempo('key', 'im here for 3sec', '3s') //will set the value 'im here for 3sec' and delete it after 3sec
    <table>.push('key', 'blabla') //will push in the array 'blabla' where key is 'key' (the value will be created if the key 'key' was not existing with a default value of [])
    <table>.remove('key', 'blabla') //reverse of 'push'
    <table>.add('key', 2) //will add 2 where the key is 'key' (the value need to be an integer, the value will be created if the key 'key' was not existing with a default value of 0)
    <table>.subtrack('key', 2) //reverse of 'add'
    <table>.all() //will return all values of the table
    <table>.delete('key') //will delete the value where the key is 'key'
    <table>.clear() //will delete everything in the table
    <table>.save() //save the table in the online database

    🔶⎠ Contact us

    In case you have idea's to improve the package, or maybe you found some bugs or you need help, you can contact us from our discord server!

    Discord support server

    Install

    npm i luma-db

    DownloadsWeekly Downloads

    141

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    16.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • jeotique