An HTTP Client with middleware, with built-in support for major web services.
To use Rem with Node.js, install using npm
:
npm install rem
To use in the browser, include lib/rem.js
.
A Node.js script to access and configure the Github API, in just 6 lines:
var rem = require('rem');
rem.connect('github.com').prompt(function (err, user) {
user('user').get(function (err, profile) {
console.log('Hello %s!', profile.name);
});
});
rem.connect('github.com')
creates a Github API Client. prompt
asks you for API configuration and prompts you to log in. user
is an authenticated API that can access endpoints like 'user'
, returning a JSON blob like profile.name
.
Look at the Wiki for API Documentation.
- See code for popular REST services.
- See code for using Rem to authenticate users with Express, from the command line, or out-of-band login.
- See code for using Rem in the browser.
MIT.