Socket
Book a DemoInstallSign in
Socket

reliefweb

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reliefweb

JavaScript and node.js bindings for the Reliefweb API

latest
Source
npmnpm
Version
0.4.3
Version published
Maintainers
4
Created
Source

reliefweb.js

JavaScript and Node bindings for the ReliefWeb API. Read the docs on ReliefWeb.int or get started with the API.

Build Status npm version Bower version

Installation

Install via NPM

Checkout this repository and run:

npm install

Include in your code with

var reliefweb = require("reliefweb");

Manual installation

Download the latest code from GitHub, and include lib/reliefweb.js in your html.

<script type="text/javascript" src="node_modules/superagent/superagent.js"></script>
<script type="text/javascript" src="lib/reliefweb.js"></script>

Usage

Node.js

var reliefweb = require('reliefweb');
var rw = reliefweb.client();

rw.reports(1414, function(err, response) {
  console.log(response.body);
});

Browser <script>

<script type="text/javascript">
    var rw = reliefweb.client();

    rw.reports(1414, function(err, response) {
        console.log(response.body);
    });
</script>

Running Tests

  • Install all dev dependencies.
  • Use make test or make jenkins
  • To specify configuration for the tests, such as the host, we are using the node-config library. ** For example, export NODE_CONFIG='{"api":{"host":"api.rwlabs.org"}}'

Tips & Tricks

Get the full URL in the response callback

    rw.reports().end(function(err, response) {
      var request = response.request;
      console.log(request.url);
    });

Keywords

reliefweb

FAQs

Package last updated on 30 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts