Git Product home page Git Product logo

node-parse-api's Introduction

Node Parse API

IMPORTANT NOTE: This api is not currently maintained. If I were starting a parse project today using node.js, I would probably start out with https://github.com/shiki/kaiseki

install

npm install parse-api

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);
});

insert file

var fs = require('fs'),
	fileName = 'myMedia.mp3';
fs.readFile(fileName, function (err, data) {
	if (err) throw err;
	app.insertFile(fileName, data, 'audio/mpeg', function(err, response){
		if(err) throw err;
		console.log('Name: ' + response.name);
		console.log('Url: ' + response.url);
	});
});

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
});

node-parse-api's People

Contributors

sethgho avatar tenorviol avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.