fastly

1.0.1 • Public • Published

fastly

Fastly API client for Node.js

Build Status

Installation

npm install fastly

Basic Use

var fastly = require('fastly')('yourapikey');

fastly.request('GET', '/content/edge_check?url=mysite.com/foo', function (err, obj) {
    if (err) return console.dir(err);   // Oh no!
    console.dir(obj);                   // Response body from the fastly API
});

Helper Methods

The fastly module also includes a few limited "helper" methods that make working with common API resources a bit simpler:

Method Example
purge
fastly.purge('host.com', '/index.html', callback);
Link
purgeAll
fastly.purgeAll('myServiceId', callback);
Link
purgeKey
fastly.purgeKey('myServiceId', 'key', callback);
Link
stats
fastly.stats('myServiceId', callback);
Link

Testing

npm test

Readme

Keywords

none

Package Sidebar

Install

Version

1.0.1

License

MIT

Last publish

Collaborators

  • harmony7
  • integralist
  • triblondon