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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gelato

v0.0.18

Published

Mobile Data service SDK for IBM Bluemix

Downloads

56

Readme

Mobile Cloud Services JavaScript SDK for IBM Mobile Data for Bluemix

This package contains the required native components to interact with the IBM Mobile Cloud Services for Bluemix. You can use the JavaScript SDK to build server-side applications Node.js

When you use Bluemix to create a Mobile Cloud application, BlueMix provisions multiple services under a single application context. Your mobile application is given access to the following mobile services: Mobile Data.

Get the SDK with NPM (Node.js)

NPM is included in current Node.js distributions. To install Node.js, go to Download Node.js.

Use the following command to install the ibmdata package:

npm install gelato

##Get started

//
// edit config/default.json and enter your app info
//
// {
//     "gelato" : {
//         "agent" : <agent URL>
//         "agentPort" : <agent port>,
//         "appId" : <appid>,
//         "appSecret" : <app secret>,
//         "appKey" : <app key>
//     }
// }
//

// initialize sdk
var gelato = require('gelato')

// issue a query
gelato.query( query, function(err, docs) {
    ...
})

// find all instances of a given type
gelato.ofType(className, function(err, docs) {
    ...
})

// find the object with the given id
gelato.forObjectId(id, function(err, obj) {
    ...
})

// create an object
gelato.create(className, { "name" : "bob", age : 30 }, function(err,obj) {
    ...
})

// delete by ID
gelato.deleteById(id, function(err, res) {
   ...
})

// find all class names
gelato.classNames(function(err, names) {
   ...
})

// save an object
gelato.save(obj, function(err,res) {
   ...
})

// The low-level query API
//     limit might be lowered by implementation
gelato.query({ limit : 10, predicate : { x : 10 }}, function(err,res) {
    if (err) throw ...
    var bookmark = res.bookmark
    var objects = res.objects
    var n = objects.length
    ...
});

// The predicate API, you can't specify limit, bookmark, ...
gelato.perdicate({ x : 10}, function(err, res) {
   ...
});

// The batch API, we give you arrays of objects
//       limit is per batch
//       we'll keep feeding you objects until either:
//             - no more objects or
//             - you don't call next
gelato.batch({ limit : 10}, function(err, array, next) {
    if (err) throw ...

    if (array == null) {
        // no more objects
    } else {
        // work with array of objects
        if (needMore) {
            next()
        } else {
            // don't call next
        }
    }
})
        
// The stream API, we give you one object at a time
//       limit is a hint for how many to bring from server per request
//       we'll keep feeding you objects until either:
//             - no more objects or
//             - you don't call next
gelato.batch({ limit : 10}, function(err, obj, next) {
    if (err) throw ...

    if (array == null) {
        // no more objects
    } else {
        // work with array of objects
        if (needMore) {
            next()
        } else {
            // don't call next
        }
    }
})
        
// convenience predicate generator
var predicate = gelato.eq('x',10).eq('.className',"Person").gen();
var predicate = gelato.eq('x',10).or(gelato.eq('y',100)).gen();

// you can also generate complete queries
var query = gelato.eq('x',10).gt('y',200).limit(10).bookmark('ERFVs').gen();

// you can also issue a query directly
gelato.eq('x',10).eq('z','abc').stream(function(err,obj,next) {
    ....
})

// generic RPC
gelato.rpc('service','method',attributes,function(err, reply) {
    ...
})

##Learn More

Licensed Materials - Property of IBM (C) Copyright IBM Corp. 2013, 2014. All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Terms of Use | Notices