From 3762082dee0e676a927a48daf3cb5be7bda0bda6 Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Sun, 6 Nov 2011 07:40:12 -0800 Subject: [PATCH] npm and readme stuff --- index.js | 1 + package.json | 9 +++++++++ readme.md | 22 +++++++++++++++++----- test/Parse.test.js | 2 +- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 index.js create mode 100644 package.json 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;