Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tenorviol committed Nov 6, 2011
1 parent d0c0bde commit d7c30d1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
40 changes: 40 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Node Parse API
==============

install
-------

npm install parse-api

examples
--------

var Parse = require('parse-api').Parse;

var APP_ID = ...;
var MASTER_KEY = ...;

var app = new Parse(APP_ID, MASTER_KEY);

// add a Foo object, { foo: 'bar' }
app.insert('Foo', { foo: 'bar' }, function (err, response) {
console.log(response);
});

// the Foo with id = 'someId'
app.find('Foo', 'someId', function (err, response) {
console.log(response);
});

// all Foo objects with foo = 'bar'
app.find('Foo', { foo: 'bar' }, function (err, response) {
console.log(response);
});

app.update('Foo', 'someId', { foo: 'fubar' }, function (err, response) {
console.log(response);
});

app.delete('Foo', 'someId', function (err) {
// nothing to see here
});
4 changes: 2 additions & 2 deletions test/Parse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!application_id || !master_key) {

// global objects to test against
var parse = new Parse(application_id, master_key);
var className = 'foo';
var className = 'NodeParseApiTest';
var object = { foo: Math.floor(Math.random() * 10000) }; // ERROR: if you change the type
var stub;

Expand Down Expand Up @@ -53,7 +53,7 @@ exports.update = function (assert) {
parse.update(className, stub.objectId, object, function (err, response) {
err && console.log(err);
assert.ok(response);
exports.find(assert);
exports.find(assert); // retest find on the updated object
});
};

Expand Down

0 comments on commit d7c30d1

Please sign in to comment.