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

yorm

v1.0.3

Published

A superlight ORM

Downloads

19

Readme

Releases

1.0.2, 1.0.3: Readme update

1.0.1: Major upgrade

Transaction support of mysql can be used now by just pass a connection object to saveone and savemany.
Bufferinit has to be called first now if it is the first time to call any function.
No more Bluebird dependency since it is part of node now.
Better module exports organization.
Config file name changed to config/db.js

0.1.20: Previous one

Install Locally is recommended

npm install yorm -s

Usage

Create your database configuration in db.js in your project root/config folder. There is a sample with yorm module folder.

Then create your application tables. You can also define your own structure types as well.

Below example will call parallelly saveone and savemany.

create table aa(id1 int, id2 int, val1 char(20), primary key(id1, id2)
var yorm = require('yorm')
var onerecord = {}
onerecord.id1 = '1'
onerecord.id2 = '20'
onerecord.val1 = 'Testing value'

var test = function() {
    yorm.saveone('aa', onerecord)
    var records = []
    for (var i = 0; i < 10, i++) {
      for (var j = 0; j < 3, j++ {
        onerecord = {'id1': i, 'id2':j, 'val1': 'value: ' + i + '/' + 'j'}
        records.push(onerecord)
      }
    }
    yorm.savemany('aa', records).then(function() {
      console.log('Table aa had been inserted many records.'
    }
}

#Now you have to call bufferinit for first time call. So change setTimeout(test, 1000) to below:
yorm.bufferinit().then(test)

Run the test and check table data by

select * from aa;

Your will see the value inserted. Also in the above example, savemany will assemble sql statemnets in batch in the form of insert into ... on duplicate update ... But you have to enable on duplicate update by set relevant parameter to true.

I will deliver an API document if more persons are interested in this project.