โšก It is a simplified database module with multiple functions that you can use simultaneously with sqlite, yaml, firebase and json.

Overview

Prisma Database

Developed with ๐Ÿ’™ by Roxza

โšก An easy, open source database


npm version npm info

๐Ÿ“ฆ Installation

npm i prisma.db --save
yarn add prisma.db

๐Ÿ”ฎ Importing

import {
  JsonDatabase,
  sqliteDatabase,
  YamlDatabase,
  FireDatabase,
} from "prisma.db"; // esm
const {
  JsonDatabase,
  sqliteDatabase,
  YamlDatabase,
  FireDatabase,
} = require("prisma.db"); // common

โœจ Different uses

Json

const { JsonDatabase } = require("prisma.db");
const db = new JsonDatabase({ dbPath: "./db.json" });

Sqlite

const { sqliteDatabase } = require("prisma.db");
const db = new sqliteDatabase({ dbPath: "./db.sqlite", dbName: "db" });

Yaml

const { YamlDatabase } = require("prisma.db");
const db = new YamlDatabase({ dbPath: "./db.yaml" });

Firebase

// It is suitable for small projects.
const { FireDatabase } = require("prisma.db");
const db = new FireBase({
  service: require("./service.json"),
  collection: "data",
});

๐Ÿ“ Usage

/* Database Set and Push Example */

db.set("hello", "world"); /* String: World */

db.set("posts", [{ id: 1 }]); /* Array: [{ id: 1 }] */

db.push("posts", { id: 2 }); /* Array: [{ id: 1 }, { id: 2 }] */

/* Database Example */

db.type("hello"); /* String: "string" */

db.size(); /* Number: 1 */

db.fetch("hello"); /* String: World */

db.get("posts"); /* Array: [{ id: 1 }, { id: 2 }] */

db.dataAll(); /* Object: { hello: "World", posts: [{ id: 1 }, { id: 2 }] } */

db.clear(); /* Object: {} */

db.destroy(); /* Object: {} */

/* Database Boolean Functions */

db.has("world"); /* Boolean: false */

db.has("posts"); /* Boolean: true */

/* Database Maths Functions */

db.set("a", 1);

db.add("a", 1); /* Number: 2 */

db.subtract("a", 1); /* Number: 1 */

db.math("a", "+", 12); /* Number: 13 */

db.math("a", "-", "1"); /* Number: 12 */

db.math("a", "*", "2"); /* Number: 24 */

db.math("a", "/", "2"); /* Number: 12 */

db.math("a", "%", "5"); /* Number: 1 */

// Firebase Usage

const { FireDatabase } = require("prisma.db");
const db = new FireDatabase({
  service: require("./service.json"),
  collection: "test",
});

db.set("mars", { hello: "world" }); // returns { hello: "world" }
db.push("mars", "livings", { name: "test" }); // returns { name: "test" }

db.get("mars"); // returns { hello: "world" }
db.fetch("mars"); // returns { hello: "world" }

db.has("mars"); // returns true
db.has("mars", "livings"); // returns true

db.delete("mars", "livings"); // returns true
db.clear("mars"); // returns true
db.destroy("mars"); // returns true

db.dataAll(); // returns { mars: { hello: "world" } }

db.type("mars", "hello"); // returns "object"
db.type("mars", "livings"); // returns "array"

db.add("mars", "population", 1); // returns 1
db.subtract("mars", "population", 1); // returns 0
db.math("mars", "population", "*", 10); // returns 10

// parameters that you can use in the math function; * + - / %

๐Ÿ“œ Multiple use

const { JsonDatabase } = require("prisma.db");

const a = new JsonDatabase({ dbPath: "./a.json" });
const b = new JsonDatabase({ dbPath: "./b.json" });
const c = new JsonDatabase({ dbPath: "./c.json" });

a.set("a", 1); /* Number: 1 */
b.set("b", 2); /* Number: 2 */
c.set("c", 3); /* Number: 3 */

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

๐Ÿ’Œ License

Webscreen is licensed under the [MIT License]. The terms of the license are as follows:

The MIT License (MIT)

Copyright (c) 2022 - Roxza

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You might also like...

JCS (JSON Canonicalization Scheme), JSON digests, and JSON Merkle hashes

JSON Hash This package contains the following JSON utilties for Deno: digest.ts provides cryptographic hash digests of JSON trees. It guarantee that d

Sep 2, 2022

Package fetcher is a bot messenger which gather npm packages by uploading either a json file (package.json) or a picture representing package.json. To continue...

package-fetcher Ce projet contient un boilerplate pour un bot messenger et l'executable Windows ngrok qui va permettre de crรฉer un tunnel https pour c

Mar 29, 2022

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Dec 29, 2022

This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Nov 12, 2022

Userland module that implements the module path mapping that Node.js does with "exports" in package.json

exports-map Userland module that implements the module path mapping that Node.js does with "exports" in package.json npm install exports-map Usage co

May 31, 2022

The Chat'Inn is a simple and minimal realtime chat application whose database is powered by firebase and firestore.

The Chat-in The Chat'Inn is a simple and minimal realtime chat application whose database is powered by firebase and firestore. The frontend part is c

Aug 8, 2022

Angular 14 Firebase CRUD with Realtime Database - AngularFireDatabase Object and List example: create, retrieve, update, delete

Angular 14 Firebase CRUD with Realtime Database - AngularFireDatabase Object and List example: create, retrieve, update, delete

Angular 14 Firebase CRUD example with Realtime DataBase | AngularFireDatabase Build Angular 14 CRUD example with Firebase Realtime Database that uses

Dec 26, 2022

A simple, easy to use and extendible JSON database.

A simple, easy to use and extendible JSON database.

Newton โš ๏ธ This package is under active development: Compatibility and APIs may change. A simple, easy to use and extendible JSON database. Table of co

Dec 6, 2022

Project to manage multiple emails at once with lots of customization. You can send and receive emails. Desktop notifications can be modified.

Project to manage multiple emails at once with lots of customization. You can send and receive emails. Desktop notifications can be modified.

Technologies Used React Redux Tailwind CSS Features Admin dashboard User settings and or user dashboard send emails recive emails Connections through

Dec 17, 2022
Comments
Owner
Roxza
Hello, I am a backend developer, I am a 16 year old high school student, I have a very curious personality, I like to do new things.
Roxza
A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML

Shuruhatik 5 Dec 28, 2022
Login of app to remind to drink water, using Firebase tools like Firebase Auth and Firebase Firestore

Water Reminder Login App Menu Contents Motivation Final Images How to download the project and run it? Technologies utilized Dev ?? Motivation This ap

Ilda Neta 10 Aug 22, 2022
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
โšก๐Ÿš€ Call multiple view functions, from multiple Smart Contracts, in a single RPC query!

ethers-multicall โšก ?? Call multiple view functions, from multiple Smart Contracts, in a single RPC query! Querying an RPC endpoint can be very costly

Morpho Labs 20 Dec 30, 2022
Visualize and download JSON / YAML content

Graphize ?? Visualize and download JSON / YAML content in your browser Demo Key Features Preview your JSON / YAML documents instantly Pinch / Scroll Z

Varun A P 25 Dec 26, 2022
Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

openapi-zod-client Generates a zodios (typescript http client with zod validation) from a (json/yaml) OpenAPI spec (or just use the generated schemas/

Alexandre Stahmer 104 Jan 4, 2023
Vite plugin to client bundle i18next locales composited from one to many json/yaml files from one to many libraries. Zero config HMR support included.

vite-plugin-i18next-loader yarn add -D vite-plugin-i18next-loader Vite plugin to client bundle i18next locales composited from one to many json/yaml f

AlienFast 4 Nov 30, 2022
An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Snyk Labs 57 Dec 28, 2022
Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Vineeth.TR 16 Dec 6, 2022
โšก A powerful, human-friendly database library for JavaScript using SQLite.

great.db โšก A powerful, human-friendly database library for JavaScript using SQLite. Elegant way to set and retrieve data Queries are executed through

null 54 Nov 29, 2022