nautical
v1.0.0
Published
Wrapper for DigitalOcean's v2 API
Downloads
11
Maintainers
Readme
It's a wrap(per)
This node module wraps DigitalOcean's v2 API.
Install
Install the module by running the following commands on your command line
$ npm install --save nautical
Usage
It's encouraged to put your DigitalOcean API token in a configuration file like:
File: config.json
{
"nautical": {
"token": "your_token_here"
}
}
Then you can use the wrapper like this:
var config = require('./config.json').nautical,
nauticalClient = require('nautical').getClient(config),
imageList = [];
nauticalClient.images.list(callback);
function callback(err, reply) {
if (err) throw err;
console.log({
responseBody: reply.body,
statusCode: reply.res.statusCode,
headers: reply.res.headers
});
imageList = imageList.concat(reply.body.images);
// get the next page
if ('function' === typeof reply.next)
reply.next(callback);
else
console.log(imageList);
}
Participate in development
Pull requests will be greatly appreciated :)
More information
For more information visit the DigitalOcean developers portal