A tiny Facebook API client
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
node_modules
test
.gitignore
.npmignore
README.md
index.js
package.json

README.md

Tiny Facebook Wrapper

NPM NPM

Tiny Facebook Wrapper is the smallest facebook client with the longest name that you will ever see. It doesn't care about authentication because passport.js can handle this for you. But don't worry, this module supports the basic operations you need for your project.

Install

$ npm install tiny-facebook-wrapper

Get request

var facebook = require('tiny-facebook-wrapper');

facebook.get('/me', {fields : ['name', 'gender']}, function (error, res) {
  if (!error) {
    console.log(res); //json response
  }
});

or

facebook.get('/me/groups', accessToken, function (error, res) {
  if (!error) {
    console.log(res); //json response
  }
});

or

facebook.get('/me', function (error, res) {
  if (!error) {
    console.log(res); //json response
  }
});

Post request

var facebook = require('tiny-facebook-wrapper');

facebook.post('/me/feed', accessToken, {message : 'I love Node'}, function (error, res) {
  if (!error) {
    console.log(res); //json response
  }
});

Delete request

var facebook = require('tiny-facebook-wrapper');

facebook.del(postId, accessToken, function (error, res) {
  if (!error) {
    console.log(res); //json response
  }
});

TODO

Support photo uploading via multipart/form-data

Testing

Before running any test, you need to add a valid accessToken which you can get via passport.js or everyauth.

$ mocha test/ -R spec //I will hack a makefile for this

License

MIT