Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cakebaker/node-url-expander
An URL expander for node.js
https://github.com/cakebaker/node-url-expander
Last synced: about 2 months ago
JSON representation
An URL expander for node.js
- Host: GitHub
- URL: https://github.com/cakebaker/node-url-expander
- Owner: cakebaker
- Created: 2011-02-17T08:29:10.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-04-15T05:22:40.000Z (over 13 years ago)
- Last Synced: 2024-11-01T07:17:46.013Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 193 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# node-url-expander
node-url-expander is an url expander for [node.js](http://nodejs.org).
## Requirements
- node.js v0.4.x
## Installation
$ npm install url-expander
## Examples
var UrlExpander = require('url-expander');
var expander = new UrlExpander(['http://example.com', 'http://example.net']);
// the "expanded" event is emitted once after all urls have been expanded
expander.on('expanded', function (originalUrls, expandedUrls) {
// do something
});
// the "singleUrlExpanded" event is emitted for each expanded url
expander.on('singleUrlExpanded', function (originalUrl, expandedUrl) {
// do something
});
expander.expand();For expanding a single url you can also use:
var SingleUrlExpander = require('url-expander').SingleUrlExpander;
var expander = new SingleUrlExpander('http://example.com');
expander.on('expanded', function (originalUrl, expandedUrl) {
// do something
});
expander.expand();## Tests
Running the unit tests:
$ nodeunit test/tests/*
Running the integration tests:
$ node integration-test.js
## License
node-url-expander is licensed under the MIT license.