Osmos: a strict, store-agnostic object data mapper for Node.js
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.
-
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.
Installation
npm install osmos-lite --save
Usage
Using Osmos requires the following steps:
-
Create a driver instance. A driver instance connects Osmos to a data store. Learn more about drivers.
-
Define your schemas. A schema describes the structure of a document, and defines how its data is transformed and validated. Learn more about schemas
-
Define your models. A model applies a schema to data that is extracted from a data store's specific bucket. Learn more about models
-
CRUD. Models can be used to create, read, update and delete existing document. Two find methods are also supplied. Learn more about documents.
-
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
$ git summary
project : osmos-lite
repo age : 2 years, 1 month
active : 131 days
commits : 371
files : 41
authors :
185 Limian Wang 49.9%
182 Marco Tabini 49.1%
3 Yehezkiel Syamsuhadi 0.8%
1 Daniel Prata 0.3%