npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

savanahdb

v1.0.3

Published

A Full-blown Database Server and Client written completely in Javascript. Real-time syncing, updating and manipulating with very low latency, scale your app to the next level!

Downloads

31

Readme

Introduction to Savanah

Edition Release Version Activity

Savanah Saber Edition

SavanahDB

A Full-blown Professional Database Management Software written completely in Javascript

Support and Contribution

To request new features, keep up with the updates and get support, Join the Official Discord Server : Invite

This package is developed, maintained and updated with a single person. If you would like to financially support the creator and thereby this package consider becoming a patron : Patreon

Basic Documentation

Setting up a Server

Write the below code in a file

server.js

import { Server } from 'savanahdb'

let server = new Server({
    path : "/var/data/",
    masterKey : process.env.MASTER_KEY   
})

By default it listens in http://localhost:7777 but it can be changed by passing host,port in the Server options

Run it with pm2

Connecting to the Server

import { Client } from 'savanahdb'

let client = new Client({
    user : "root",
    pass : "create a new admin account with a secure password and delete this"   
})

let db = client.db("demo")

let tb = db.table("no")

The above credentials are the Default ones, please do remember to create a new user and delete the root user

Insert

Inserting data into a table is easy, structure the data into JSON Format and pass it to insert() function of a Table

tb.insert({
   author : "Robert",
   price : 120,
   premium : true
})

or to insert a set of documents :

tb.insertSet([{
   author : "Robert",
   price : 120,
   premium : true
},{
   author : "John",
   price : 40,
   premium : false
}])

Search

Valid Operators : !=, ==, ===, >, <, >=, <=

Get an array of documents that match a given condition

tb.search('name == "John"') // gets all documents with name as John

tb.search('( name == "John" && price > 100 ) || premium === true') 
// you can group conditions to get better suited results

tb.search('name != "John"' , {
  join : {
       authors : 'that.name == this.author as author_info'
  },
  limit : 5
})
//joins documents from other tables. Here "authors" is the table from 
// which the data is going to be joined
// and limits the result to a maximum of 5 Documents

Update

Update existing data with a condition and limit

tb.update('author == "John"' , {
  premium : false,
  _inc : ['rep', 'price'] // increment properties
} , { limit : 2 })

Limits defaults to 1, pass "none" as limit to update all records that satisfy the condition

Delete

tb.delete('premium === false')

Limits defaults to 1, pass "none" as limit to delete all records that satisfy the condition

Guides and documentation covering more advanced concepts like sharding, etc.. are in https://www.gitbook.com/

Copyright (c) 2021 Keerthi Vasan [email protected]

Patreon : here

Discord Server : Invite

License

Click here to read the License