Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

conde-nast-international/fastly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastly

Fastly API client for Node.js

Build Status dependencies 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
softPurgeKey
fastly.softPurgeKey('myServiceId', 'key', callback);
Link
stats
fastly.stats('myServiceId', callback);
Link
datacenters
fastly.datacenters(callback);
Link
publicIpList
fastly.publicIpList(callback);
Link
edgeCheck
fastly.edgeCheck('url', callback);
Link

Testing

npm test

About

Fastly API client for Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 96.0%
  • Makefile 4.0%