url-status
v0.1.1
Published
Returns the status of an HTTP get request.
Downloads
251
Readme
url-status
Returns the status of an HTTP get request.
Install
npm install url-status --save
Usage
var urlStatus = require('url-status')
urlStatus('http://httpbin.org/get', function(status){
console.log(status)
// { code: 200, message: 'OK', type: 'Online' }
})
urlStatus('http://notarealdomain35252.org/', function(status){
console.log(status)
// { code: false, message: false, type: 'Offline' }
})
urlStatus('http://httpbin.org/404', function(status){
console.log(status)
// { code: 404, message: 'Not Found', type: 'Error' }
})
Todos
- Add error descriptions
- Complete testing
Contributing
Forks and pull requests are most welcomed.
Please run npm test
before sending a pull request.
MIT license
Copyright (c) 2014, Montana Flynn (http://anonfunction.com/)