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

@obayd/nodeorm

v1.0.1

Published

NodeORM - A powerful and elegant ORM (Object-Relational Mapping) library for Node.js, inspired by Laravel's Eloquent. Simplify database interactions and streamline your Node.js application development.

Downloads

9

Readme

NodeORM cover

NodeORM - A laravel-like database management library for nodejs

NodeORM is a lightweight and flexible Object-Relational Mapping (ORM) library for Node.js applications inspired by Laravel's one. It provides a seamless interface between JavaScript objects and relational databases, making it easier for developers to interact with their databases using familiar JavaScript syntax.

It simplifies and streamlines the process of working with relational databases, making database interactions more intuitive and developer-friendly. It empowers developers to focus on building robust applications without worrying about the complexities of database management. Whether you are working with MySQL, SQLite, or custom database solutions, NodeORM offers a seamless and consistent interface for your database needs.

Keyfeatures

  • Database Agnostic: NodeORM supports multiple database drivers, including MySQL, SQLite, and custom raw function drivers, allowing users to work with their preferred databases.

  • Model Definition: Users can define their database models with properties such as table name, columns, and primary keys. This enables easy mapping of database tables to JavaScript classes.

  • Fluent Query Building: With a fluent method chaining syntax, NodeORM allows users to construct complex SQL queries in a natural and intuitive way, making it easy to create dynamic queries for database operations.

  • ModelItem Class: The ModelItem class represents individual items (rows) in the database table with CRUD methods. Users can interact with specific database records using this class.

  • Collection Class: The Collection class represents a group of ModelItems with grouping and filtering capabilities. It enables users to work with multiple records as a cohesive unit.

  • Error Handling: NodeORM defines custom error classes for specific error scenarios, such as EmptyDataError and UnmatchingStateError. This helps users handle errors more effectively and gracefully.

  • Dynamic Model Creation: Users can dynamically create models during runtime, eliminating the need to predefine them. This flexibility allows for more dynamic and adaptive database interactions.

  • Lazy Loading: NodeORM employs lazy loading optimizations during iteration, improving performance when dealing with large datasets.

  • Dependency-less: A plug and play library.

  • Fully compatible: The library automatically works with mysql, mysql2 and-or sqlite3.

  • Multi connections: You can connect to multiple databases at the same time seamlessly.

  • Unblocking structure: This library is based on async-await syntax.

  • And much other stuff...

Installation

Currently you can install it directly from github

npm install obaydmerz/nodeorm

Examples

// SQLite example
import { Model } from "@obayd/nodeorm";

class Test extends Model {}

(async () => {
  await Model.init("C:/Users/Hello/Documents/mysqlite.db", Test);

  const my = await Test.last();
  console.log(my.myVal);
})();
// MySQL example
import { Model } from "@obayd/nodeorm";

class Test extends Model {}

(async () => {
  await Model.init("mysql://root@localhost:3306", Test);

  const my = await Test.last();
  console.log(my.myVal);
})();

Easy, isn't it?

Read more

For more information and advanced usage, check out the NodeORM Wiki

You can join our discord server.