diff --git a/index.js b/index.js new file mode 100644 index 0000000..8132852 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +exports.Parse = require('./lib/Parse'); diff --git a/package.json b/package.json new file mode 100644 index 0000000..f130dd0 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "parse-api", + "description": "API for accessing Parse.com applications", + "version": "0.1.0", + "author": "Chris Johnson ", + "repository": "git://github.com/tenorviol/node-parse-api", + "main": "index", + "engines": { "node": ">= 0.4.0" } +} \ No newline at end of file diff --git a/readme.md b/readme.md index 4541ebf..c7912ea 100644 --- a/readme.md +++ b/readme.md @@ -9,32 +9,44 @@ install examples -------- +### setup + var Parse = require('parse-api').Parse; var APP_ID = ...; var MASTER_KEY = ...; var app = new Parse(APP_ID, MASTER_KEY); - + +### insert + // add a Foo object, { foo: 'bar' } app.insert('Foo', { foo: 'bar' }, function (err, response) { console.log(response); }); - + +### find one + // the Foo with id = 'someId' app.find('Foo', 'someId', function (err, response) { console.log(response); }); - + +### find many + // all Foo objects with foo = 'bar' app.find('Foo', { foo: 'bar' }, function (err, response) { console.log(response); }); - + +### update + app.update('Foo', 'someId', { foo: 'fubar' }, function (err, response) { console.log(response); }); - + +### delete + app.delete('Foo', 'someId', function (err) { // nothing to see here }); diff --git a/test/Parse.test.js b/test/Parse.test.js index 6deb6bf..dd2bef0 100644 --- a/test/Parse.test.js +++ b/test/Parse.test.js @@ -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 var application_id = process.env.APPLICATION_ID;