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

osmos-lite

v1.2.0

Published

A general purpose, strict, simple ORM for Node.js apps

Downloads

13

Readme

Osmos: a strict, store-agnostic object data mapper for Node.js

Build Status Coverage Status npm npm Dependency Status devDependency Status

Osmos is a object data mapper (ODM) designed to bridge Node.js apps with any data store that support traditional CRUD operations. It's built on three principles:

NOTE

osmos-lite is a forked version of Osmos-odm aiming to provide support for iojs, node > 0.10. One of the major reasons for forking is to be able to iterate fast, and break things earlier without having too much of an impact.

  • Stay out of the way. Osmos is intuitive and largely transparent to developers, and, most of all, doesn't attempt to be “smarter” than its human masters. It can also be easily mocked away for testing without having to write specialized code.

  • Fail early, and fail loudly. In debug mode, Osmos uses Direct Proxies to trap access to a document; if attempts are made to read or write non-existent fields, an error is immediately thrown to help you and pinpoint common mistakes before they end up in production.

  • Don't replace developer knowledge. Osmos is designed to be a generic ODM that will work well with just about any data store that supports CRUD operations. However, it is not meant to be an abstraction layer; instead, it assumes that developers know best, and provides only a simple interface that can be easily extended through plugins.

The current version of Osmos supports MongoDB, MySQL and ElasticSearch, but it should be easy to write drivers for just about any data store—and contributions are warmly welcome! The library also includes a simple, memory-based data store that can be used for testing purposes.

Installation

npm install osmos-lite --save

Note that, in debug mode (which is the default mode), Osmos uses Direct Proxies in order to work. Therefore, you must run your instance of node with the --harmony-proxies command-line switch. See the docs for information on how to turn off debug mode in production for extra performance.

Usage

Using Osmos requires the following steps:

  1. Create a driver instance. A driver instance connects Osmos to a data store. Learn more about drivers.

  2. Define your schemas. A schema describes the structure of a document, and defines how its data is transformed and validated. Learn more about schemas

  3. Define your models. A model applies a schema to data that is extracted from a data store's specific bucket. Learn more about models

  4. CRUD. Models can be used to create, read, update and delete existing document. Two find methods are also supplied. Learn more about documents.

  5. Additional functionality can be also added to Osmos by a plugin or by a driver—for example, to provide access to features of a data store that are not part of the basic CRUD quartet.

Roadmap

Next iteration of updates will focus heavily on the fixes and enhancement for osmos-lite, use Promises, and increase the test coverage.

Contributing

Contributions are always welcomed via pull requests, and they should always have associated tests. TravisCI will need to pass prior to merging.

Contributors

 project  : osmos
 repo age : 1 year, 11 months
 active   : 117 days
 commits  : 336
 files    : 48
 authors  :
   182	Marco Tabini          54.2%
   150	Limian Wang           44.6%
     3	Yehezkiel Syamsuhadi  0.9%
     1	Daniel Prata          0.3%