0.2.11 • Published 4 years ago

slayercio-json-database v0.2.11

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Slayercio JSON Database

It's a small json database library to use in your Javascript / Typescript projects. It saves files as base64 encoded JSON string and automatically loads at initialization. Only dependency it has is slayercio-logger that's used to log errors.

Usage

  1. Import Database class from library

    // JavaScript
    const { Database } = require("slayercio-json-database");
    // TypeScript
    import { Database } from "slayercio-json-database";
  2. Create new Database

    const database = new Database(
      Name /* Name of the database */,
      Path /* Path to the database file*/
    );
  3. Elements operations

    • 3.1 Add to database
      // Returns index of added element
      let indexOfElement = database.AddElement(Object);
    • 3.2 Remove from database
      // Returns if element was successfully removed
      let status = database.RemoveElement(Index);
  4. Save / Load database
    • 4.1 To load database use:
    // Returns if load was successful
    database.Load();
    • 4.2 To save database use:
    // Returns if save was successful
    database.Save();
0.2.11

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.9

4 years ago

0.2.3

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago