Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/popomore/checkurl
A tiny url status check tool
https://github.com/popomore/checkurl
Last synced: 3 months ago
JSON representation
A tiny url status check tool
- Host: GitHub
- URL: https://github.com/popomore/checkurl
- Owner: popomore
- License: bsd-3-clause
- Created: 2012-11-20T14:42:54.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-18T08:43:29.000Z (over 10 years ago)
- Last Synced: 2024-10-05T01:01:35.509Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 397 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# checkurl
[![Build Status](https://travis-ci.org/popomore/checkurl.png?branch=master)](https://travis-ci.org/popomore/checkurl) [![Coverage Status](https://coveralls.io/repos/popomore/checkurl/badge.png?branch=master)](https://coveralls.io/r/popomore/checkurl?branch=master)
[![David Status](https://david-dm.org/popomore/checkurl.png)](https://david-dm.org/popomore/checkurl)
A tiny url status check tool
---
## Usage
### Check url
```
$ checkurl http://www.baidu.com
HEAD http://www.baidu.com/ -> 200
```### Check combo
```
$ checkurl http://static.alipayobjects.com/static/ar/??alipay.light.base-1.4.js,alipay.security.riskMobileAccount-1.0.js
HEAD http://static.alipayobjects.com/static/ar/alipay.light.base-1.4.js -> 200
HEAD http://static.alipayobjects.com/static/ar/alipay.security.riskMobileAccount-1.0.js -> 404
```### Check image combo
```
$ checkurl 'https://i.alipayobjects.com/combo.jpg?d=apps/24&t=10015,10016'
HEAD https://i.alipayobjects.com/common/combo/apps/24/10015.png -> 200
HEAD https://i.alipayobjects.com/common/combo/apps/24/10016.png -> 200
```### Check file
urls.txt
```
http://static.alipayobjects.com/static/ar/alipay.light.base-1.4.js
http://static.alipayobjects.com/static/ar/alipay.security.riskMobileAccount-1.0.js
```Check url in urls.txt
```
$ checkurl urls.txt
HEAD http://static.alipayobjects.com/static/ar/alipay.light.base-1.4.js -> 200
HEAD http://static.alipayobjects.com/static/ar/alipay.security.riskMobileAccount-1.0.js -> 404
```### Require module
You can require `checkurl`
```
var checkurl = require('checkurl');
checkurl('url', function(data) {
// use data
});
```Data structure
```
[
['url', 200],
['url', 404]
]
```if check single url, data structure is
```
['url', 200]
```### events
1. checked
this events will emit after every url is checked.
```
checkurl('url', function(data) {
// use data
}).on('checked', function(data){
});
```2. error
this events will emit when any url get error.
```
checkurl('url', function(data) {
// use data
}).on('error', function(err){
});
```## Install
```
npm install checkurl -g
```## License
BSD
### Thanks
https://github.com/shaoshuai0102/combocheck