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

@kgrajan12/orm

v1.0.7

Published

This is a ORM and specially made for Mysql database.

Readme

gorm

This is a ORM and specially made for Mysql database.

Changes in this version

  • Migrate to Mysql2 from Mysql.
  • removed all callbacks make that all promise.

install CLI

install this orm cli first to initiate the setup

npm install -g @kgrajan12/orm

initiate Models

After installing the gorm globally then then you can run a single command to initiate all the models of the database in current folder

gorm

Note: Please confirm that you don't have any folder like /db

Folder structure

- /current_folder
|   - /db
    |   - /model
    |   |   - / <list of models>.js
    |   - /conn.json
    |   - /index.js

Now it is asking for database credentials. Ater giving the database credentials it generate model codes for you in /db/model

Example code

From the root folder of project

const { Village } = require('./db'); // Village is your table model

const village = new Village();

// select query
village.select({
    where: {
        region_id: 144,
        pin: 627111
    }
}).then((documents) => {
    <!--Do somthing with documents response-->
}).catch((error) => {
    console.log(error);
});

Probs

Select query props

| props | type | usage | |-------|------|-------| | table | string | Here you can set different table name to Model mostly it is not used. | | columns | array | Here you can pass the list of columns to get that alone like select pin, region_id from village | | where | object | Here you can set the condition to select query. | | like | object | Here you can pass the pattern to select rows. | | orderBy | array of object | Ex: [{ column: 'pin', asc: true }] you can pass like more objects to order column when select | | join | object of Model | Here you can pass other object of Model. So that you can join two tables. | | on | object | This is same like where prop but the only different is use of this prop. this is used to join tables with condition { "village.id": "people.village_id" } that means join when id of village equals village_id of people. | | joinBy | array | Here you can manage the operator between condition variables in on prop and it is iterativly used. ex: ['AND', 'OR'] first condition checked with AND, second condition is checked with OR and the next condition will use AND again | | whereBy | array | same like joinBy but the only different is used to manage where conditions | | joinOperator | array | same like joinBy itreation. but it is used to manage operators. ex: village.id=people.village_id you can pass here =, <>, <=, >= | | whereOperator | array | same like joinOperator, To manage where operators | | joinType | string | you can pass here the type of join INNER JOIN, OUTTER JOIN like that |

Insert query props

| props | type | usage | |-------|------|-------| | data | object | ex: {name: 'Teknik GG', village: 'Radhapuram'} to insert name and village feilds. | | table | string | Here you can set different table name to Model mostly it is not used. |

Update query props

| props | type | usage | |-------|------|-------| | data | object | ex: {name: 'Teknik GG', village: 'Radhapuram'} to insert name and village feilds. | | table | string | Here you can set different table name to Model mostly it is not used. | | where | object | Here you can set the condition to select query. | | like | object | Here you can pass the pattern to select rows. |

Delete query props

| props | type | usage | |-------|------|-------| | table | string | Here you can set different table name to Model mostly it is not used. | | where | object | Here you can set the condition to select query. | | like | object | Here you can pass the pattern to select rows. |