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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sweetdb

v0.0.1

Published

💾 Simple data storage.

Readme

SweetDB

SweetDB is a data manager and data store written in TypeScript. With Sweet you have the choice between storing data in a dynamic and temporary way or in a static and permanent way. Designing a database has become simple with the implementation of a file system specific to Sweet. No knowledge is now necessary to create and manage a database.

Install it

 # Cloning repository
 $ git clone https://github.com/NessMC/sweetdb
 $ cd sweetdb
 
 # Installing NPM dependencies.
 $ npm install
 
 # Building SweetDB
 $ npm run build
 
 # Starting SweetDB
 $ npm run start

Use it

First of all, you need to create your database template. For this, you will proceed to the creation of a Sweet file. Creating, editing and modifying this kind of files doesn't require any real programming knowledge.

# database.sweet

#Database name
database App {
	# Table name
	table Users {
		# Field name
		field username {
            - type => string # Value type must be string
            - required => true # Field is required
            - maximum length => 16 # Field maximum length is 16
            - minimum length => 4 # Field minimum length is 4
		}
        field password {
            - type => string
            - required => true
            - maximum length => 32
            - minimum length => 8
        }
	}
}

You must then load this file in your Javascript code.

const sweet = require('sweetdb'),
		db = new sweet.Database('path/to/file.sweet')

You can now interact with your database easily:

db.set('Users',  {
	username:  'NessMC',
	password:  '123456789',
	email:  '[email protected]'
})

console.log(db.get('Users', {
	username: 'NessMC'
})

/*
[
	{
		username: 'NessMC',
		password: '123456789',
		email: '[email protected]'
	}
]
*/

Create templates

With Sweet, you can create templates for your fields. This allows the validation of data matching with the template. Their operation is based on regex.

# template.sweet
template email {
	- regex => (\w|\d)+@(\w|\d)+\.\w{2}
}

You can of course use it in the previously defined file containing the template of your database.

# database.sweet

database App {
	table Users {
		field email {
            - type => string
            - template => email
            - required => true
            - minimum length => 5
        }
	}
}

Javascript methods

Create database

database.create_database(name: string) : void
// Create a database with the specified name.

Example:

database.create_database('App')

Create table

database.create_table(name: string) : void
// Create a table with the specified name

Example:

database.create_table('App:Users')
// OR
database.create_table('Users')

Create_field

database.create_field(name: string, field: string, model: Object) : void
// Create or update field

Example:

database.create_field('App:Users', 'age', {
	age: {
		type: 'number',
		required: true
	}
})

Create template

database.create_template(name: string, regex: RegExp) : void
// Creating template

Example:

database.create_template('email', /someRegexHere/)

Get values

database.get(name: string, object = Object = {}) : Array<Object>
// Getting informations from specified database.

Example:

database.get('Users', {
	username: 'NessMC'
})
// OR
database.get('Users')

Remove values

database.remove(name: string, object = Object = {}) : void
// Removing informations from specified database.

Example:

database.remove('Users', {
	username: 'NessMC'
})
// OR
database.remove('Users')

Update values

database.update(name: string, object = Object = {}) : void
// Updating informations from specified database.

Example:

database.update('Users', {
	username: 'NessMC'
})
// OR
database.update('Users')

Set values

database.set(name: string, object = Object = {}) : void
// Setting informations from specified database.

Example:

database.set('Users', {
	username: 'NessMC',
	password: '321654987'
})