Git Product home page Git Product logo

fluffdb's Introduction

FluffDB

An easy to use JSON database for your simplest projects!

Documentation

Creating the database :

To create your database, simply initialize the class.

import Fluff from 'fluffdb'

const database = new Fluff("db_name")

Basic usage :

Here are some basic usage of the database :

// To set data to the database
await database.set("xp", 500)
await database.set("username", "limenade")

// To get data from the database
const xp = await database.get("xp") // 500
const username = await database.get("username") // limenade

// You can substract and add numbers with those functions
await database.add("xp", 50) // 550
await database.sub("xp", 500) // 50

Note: You can store any type of data in the databse!
Strings, numbers, objects, array and much more will work!

There are functions to manage objects and arrays :

More functions like these will come soon.

await database.set("skillPoints", [1,4,6])
await database.concat("skillPoints", [6,7,3]) // "skillPoints": [1,4,6,6,7,3]
await database.pull("skillPoints", 1) // Removes 1 from the array
await database.get("skillPoints") // [4,6,6,7,3]

In depth usage :

You can use some built-in functions to manage your database the easy way!

    await deleteFile() // Will delete the database file completely!

    await delete("xp") // Will remove the xp key from the database file

    await exists("xp") // false (we just deleted it)

    await read() // Will return the full content of the database file

More features are one their way :

  • In depth array handling
  • Ability to create the database file in a certain directory
  • Emiting events on several functions
  • JSON file formatting, to read your database smoothly
  • And much more...

fluffdb's People

Contributors

itslimenade avatar

Stargazers

 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.