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

parse-osmos-driver

v0.0.2-4

Published

A Parse SDK Driver for the OSMOS ODM

Readme

Parse Osmos Driver

Driver for Osmos ODM that uses the Parse SDK. It abstracts away the parse sdk database layer and lets you do queries using simple models and JSON schemas. Most find Queries can be done the same way you'd do with the MongoDB Driver. Great for when you can't use a professional DB, but have the possibility of moving to one in the future.

Example usage

var Osmos = require('osmos-odm');
var Schema = Osmos.Schema;
var Model = Osmos.Model;

var ParseDriver = require('parse-osmos-driver');
var Parse = require('parse').Parse;

var schema = new Schema('https://example.org/tokens', {
      id: 'https://example.org/tokens',
      $schema: 'http://json-schema.org/draft-04/schema#',

      title: 'Token Object',
      description: 'Token Object',

      type: 'object',

      required: ['account', ],

      properties: {

        objectId: {
          type: 'string',
          description: 'Token ID',
        },
        name: {
          type: 'string',
          description: 'The Account name'
        }

      });


schema.primaryKey = 'objectId';

Parse.initialize('13qrdsg3sdrt34vwefwrgisfdis4drtojiovjiwv', 'wiqoejf9endoaisldfj223fd9a9aidasfoimowf');

Osmos.drivers.register('parse', Parse);

model = new Model('TestModel', schema, 'person', 'parse');

model.create(function (err, doc) {
  doc.name = 'Marco';

  doc.save(function (err) {
    expect(err).to.be.null;

    expect(doc.primaryKey).to.be.ok();
    expect(doc.name).to.equal('Macro');

    done();
  });
});

Primary Key

Parse requires that the schema.primaryKey be set to 'objectId'.

Implemented methods

Baiscs

  • create(model, cb)

    Creates a new document and pass it to the callback. The document should be a simple hash—create's only job is to initialize any arbitrary values that are required by the specific data store.

  • get(model, key, cb)

    Retrieves a document from the store. A document-not-found error should be passed to the callback as (null, null).

  • post(document, data, cb)

    Inserts a new document into the data store. The data represents the serialized document and, under most circumstances, can be inserted directly into the data store.

    The document argument, which references the Osmos document that is requesting the insertion operation, is also passed along for convenience.

  • put(document, data, cb)

    Like post(), but for a document that has already been saved in the past.

  • del(model, key, cb)

    Deletes the document with the given key. Document-not-found errors should not result in errors being reported to the callback.

Search operations

  • findOne(model, query, cb)

    Retrieves any result that matches the given query, represented as a simple hash. query should match Parse.Query.protype._where syntax

    A not-found error should be reported as (null, null)

    For example:

    model.findOne({ email: '[email protected]' }, function (err, doc) {
        console.log(doc.email);
    });
  • find(model, spec, cb)

    Retrieves all results that match the given query, returning an array of all the documents that match the query, represented as simple hashes. A not-found error should be reported as (null, []).