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

tiny-mysql-orm

v1.0.13

Published

A Module for handling mysql queries.

Readme

In the name of ALLAH

This is a simple module that connecto to mysql and handle mysql queries. for now this module support creating database and tables and insert query.

How to use:

just import to your project and create an object like this:

const MysqlHandler = require("tiny-mysql-orm").MysqlHandler;
const mysql_handler = new MysqlHandler(host_info, create_db, tables, dev_status);//have 4 arguments, 
				//argument 1- a json obj {host: host_address, user:db_user, password: user_password, database: database_name}
			 	//argument 2- a boolean, default is false, if your turn it to true, mysql handler module create your database
			 	//argument 3- an array of json like this [{name:"", columns:[{name:"", type:""}]}] for creating your tables, you can find more info about this argument below, for now if you don't want to module create your tables just send an empty array like this []
			 	//argument 4- a boolean, default is false, this set developer mode for showing some logs

A real example of arguments:

var host_info = {host: "localhost", user: "db_user", password: "my_user_password", database: "user"};
var create_db = true;
var tables = [
	{
		name:"user", 
		columns:
		[
			{name: "id", type:"INT NOT NULL AUTO_INCREMENT"}, 
			{name: "mobile", type:"VARCHAR(16)"},
			{name: "presenter", type:"VARCHAR(16)"},
			{name: "name", type:"VARCHAR(128)"},
			{name: "creation", type: "TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"},
			{name: "about_me", type:"TINYTEXT"},
			{name: "birthday", type:"DATE"},
			{name: "profile_img", type:"VARCHAR(128)"}
		],
		unique: ["mobile"]
	}
];

note: if you turn true creation of tables, module add id column to all of tables and make it auto increament.

var dev_status = true;

tiny-mysql-orm for now have one async methods, insert().

insert method get an argument { table:"", columns: ["",], values:[[{type:"", value:""},],]} like this example:

var query = {
	database_name: "database_name",
	table:"user", 
	columns: ["mobile"], 
	values:[
		[
			{type:"varchar", value: "user_mobile"}
		]
	]
};
mysql_handler.insert(query).then((val)=>{console.log(val);}).catch((err)=>{console.log(err)});