Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reorganising module

  • Loading branch information...
commit 48620b71216e4a217c7d87bb200fdbc824d7b676 1 parent 88e9842
@cgiffard authored
View
1  .gitignore
@@ -0,0 +1 @@
+node_modules
View
0  cache-backend-fs.js → lib/cache-backend-fs.js
File renamed without changes
View
0  cache.js → lib/cache.js
File renamed without changes
View
5 index.js → lib/crawler.js
@@ -694,7 +694,4 @@ Crawler.prototype.removeFetchCondition = function(index) {
}
};
-// EXPORTS
-exports.FetchQueue = FetchQueue;
-exports.Cache = Cache;
-exports.Crawler = Crawler;
+module.exports = Crawler;
View
9 lib/index.js
@@ -0,0 +1,9 @@
+// SimpleCrawler
+// Export interfaces
+
+module.exports =
+ module.exports.crawler =
+ require("./crawler.js");
+
+module.exports.queue = require("./queue.js");
+module.exports.cache = require("./cache.js");
View
6 queue.js → lib/queue.js
@@ -20,6 +20,8 @@ var FetchQueue = function(){
this.scanIndex = {};
};
+module.exports = FetchQueue;
+
FetchQueue.prototype = [];
FetchQueue.prototype.add = function(protocol,domain,port,path,callback) {
callback = callback && callback instanceof Function ? callback : function(){};
@@ -263,6 +265,4 @@ FetchQueue.prototype.defrost = function(filename,callback) {
callback(null,self)
});
-};
-
-exports.queue = FetchQueue;
+};
View
45 package.json
@@ -1,17 +1,34 @@
{
- "name": "simplecrawler",
- "description": "Very straigntforward web crawler. Uses EventEmitter. Generates queue statistics and has a basic cache mechanism with extensible backend.",
- "version": "0.0.10",
- "homepage": "http://github.com/cgiffard/node-simplecrawler",
- "author": "Christopher Giffard <christopher.giffard@cgiffard.com>",
- "keywords": ["crawler","spider","cache","queue","simplecrawler","eventemitter"],
- "repository": {
- "type": "git",
- "url": "http://github.com/cgiffard/node-simplecrawler.git"
- },
+ "name": "simplecrawler",
+ "description": "Very straigntforward web crawler. Uses EventEmitter. Generates queue statistics and has a basic cache mechanism with extensible backend.",
+ "version": "0.1.0",
+ "homepage": "http://github.com/cgiffard/node-simplecrawler",
+ "author": "Christopher Giffard <christopher.giffard@cgiffard.com>",
+ "keywords": [
+ "crawler",
+ "spider",
+ "cache",
+ "queue",
+ "simplecrawler",
+ "eventemitter"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/cgiffard/node-simplecrawler.git"
+ },
"bugs": {
- "url": "https://github.com/cgiffard/node-simplecrawler/issues"
+ "url": "https://github.com/cgiffard/node-simplecrawler/issues"
+ },
+ "main": "./lib/index.js",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "devDependencies": {
+ "mocha": "~1.8.1",
+ "jshint": "~0.7.x",
+ "chai": "~1.2.0"
},
- "main": "./index.js",
- "engines": { "node" : ">=0.4.0" }
-}
+ "dependencies": {
+ "iconv": "~1.2.4"
+ }
+}
View
0  travis.yml
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.