Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Commit

Permalink
npm and readme stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tenorviol committed Nov 6, 2011
1 parent d7c30d1 commit 3762082
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
exports.Parse = require('./lib/Parse');
9 changes: 9 additions & 0 deletions package.json
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "parse-api",
"description": "API for accessing Parse.com applications",
"version": "0.1.0",
"author": "Chris Johnson <tenorviol@yahoo.com>",
"repository": "git://github.com/tenorviol/node-parse-api",
"main": "index",
"engines": { "node": ">= 0.4.0" }
}
22 changes: 17 additions & 5 deletions readme.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,32 +9,44 @@ install
examples examples
-------- --------


### setup

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


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


var app = new Parse(APP_ID, MASTER_KEY); var app = new Parse(APP_ID, MASTER_KEY);


### insert

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


### find one

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


### find many

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


### update

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


### delete

app.delete('Foo', 'someId', function (err) { app.delete('Foo', 'someId', function (err) {
// nothing to see here // nothing to see here
}); });
2 changes: 1 addition & 1 deletion test/Parse.test.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
var Parse = require('../lib/Parse.js'); var Parse = require('../index').Parse;


// use environment variables APPLICATION_ID and MASTER_KEY to test against // use environment variables APPLICATION_ID and MASTER_KEY to test against
var application_id = process.env.APPLICATION_ID; var application_id = process.env.APPLICATION_ID;
Expand Down

0 comments on commit 3762082

Please sign in to comment.