All Projects → ifraixedes → node-theyworkforyou-api

ifraixedes / node-theyworkforyou-api

Licence: MIT license
Node module for the They Work For You API (http://theyworkforyou.com/api)

Programming Languages

livescript
113 projects
javascript
184084 projects - #8 most used programming language

They Work For You API

This a node module for They Work For You API (http://www.theyworkforyou.com/api); I will use twfy to mention it in the rest of this document.

How to install

I've supposed that you have installed NodeJS and npm, so

npm install theyworkforyou-api

How to use

To use this module, you must have a twfy API key, which you can get easy from its website.

Then, let's start

var twfyAPI = require('theyworkforyou-api');

var twfyClient = twfyAPI('YOUR API KEY');

var promise = twfyClient.getMPs();

promise.then(
  function (data) {
    console.info('Awesome, it succeeded');
    console.info('There is ' + data.length + ' MPs');
  },

  function (err) {
    console.error('Sucks, something was wrong');
    console.error('Error message:' + err.message);
  }
);

Launch the test

To launch the tests is as pretty much straightforward as install the module, so

  • install the dev-dependencies
  • add your API key in the file config/api.json

launch the test:

make test

About the development

I developed this module with livescript so if you only are interested in the javascript code you have to compile it doing:

make build

Then you will have the javascript code in build directory

What does it need?

  1. Create a more thorough tests for all the APIs
  2. ... Fork an add your thoughts

LICENSE

Just MIT, in details in LICENSE file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].