1.0.10 • Published 5 years ago

fb-wrapper v1.0.10

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

fb-wrapper

npm Travis (.org) npm bundle size

Highly opinionated Facebook API client for Node.js

This is a small heavily opinionated utility wrapper library around facebook-node-sdk.
It is implemented with facade pattern which translates facebook-node-sdk library's existing interface into simplified one.

Install

npm i fb-wrapper

Usage:

Only most commonly used function for interacting with Facebook API are implemented:

  • postOnWall(msg: string): Promise<string>
  • getFeed()
  • getInfo(fields: string[] = 'id', 'name')
const FacebookClient = require('fb-wrapper');
const facebookClient = new FacebookClient(facebookToken, facebookAppID, facebookAppSecret);

// post on the wall
try {
  const msgToPost = 'Post a test message';
  const postId = await facebookClient.postOnWall(msgToPost);
  console.log(postId);
} catch (e) {
  console.error(e);
}

// get feed
try {
  const feed = await facebookClient.getFeed();
  console.log(feed);
} catch (e) {
  console.error(e);
}

// get info
try {
  const requestedInfo = await facebookClient.getInfo(['id', 'name']);
  console.log(requestedInfo);
} catch (e) {
  console.error(e);
}
1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago