Nanobots Protecting Microbots

    @decaded/nyadb
    TypeScript icon, indicating that this package has built-in type declarations

    1.5.0 • Public • Published

    NyaDB

    Simple JSON "database" for NodeJS.

    npm (scoped) npm bundle size (scoped) npm GitHub


    All files (databases) will be stored in the NyaDB folder in the project's root directory.


    Installation

    npm install @decaded/nyadb

    Usage

    Initialize

    const NyaDB = require('@decaded/nyadb');
    const nyadb = new NyaDB();

    Create new database

    nyadb.create('test'); // Creates a new database called 'test'

    Inserting data

    const mockDatabase = {
        yellow: ["banana", "citrus"],
        red: ["apple", "paprika"],
    };
    nyadb.set('test', mockDatabase); // Sets the database 'test' to the 'mockDatabase' object

    Retrieving data

    nyadb.get('test'); // Returns the 'test' database
    
    //  {
    //    "yellow": ["banana", "citrus"],
    //    "red": ["apple", "paprika"],
    //  } 
    nyadb.getList(); // Returns the names of all databases in an array
    
    // ['test']

    Deleting data

    nyadb.delete('test'); // Deletes the database 'test' 

    Like what i do?

    Buy Me a Coffee at ko-fi.com

    Install

    npm i @decaded/nyadb

    DownloadsWeekly Downloads

    41

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    19.6 kB

    Total Files

    12

    Last publish

    Collaborators

    • decaded