Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fs-crawler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-crawler - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/Context.js

16

gulpfile.js
'use strict';
var gulp = require('gulpfile.basics');
var gutil = require('gulp-util');
var gulpJsdoc2md = require('gulp-jsdoc-to-markdown');
var concat = require('gulp-concat');
gulp.task('doc', function() {
return gulp.src('lib/**/*.js')
.pipe(concat('API.md'))
.pipe(gulpJsdoc2md({}))
.on('error', function(err){
gutil.log('jsdoc2md failed:', err.message);
})
.pipe(gulp.dest('./'));
});
require('gulpfile.basics');
'use strict';
var Readable = require('stream').Readable;
var util = require('util');
var Context = require('./tools/context');
var fs = require('./tools/fs');
var Readable = require('stream').Readable;
var util = require('util');
var Context = require('./Context');
var Options = require('./tools/options');
var fs = require('./tools/fs');

@@ -11,82 +12,121 @@

function Crawler (options) {
if (!(this instanceof Crawler)) {
return new Crawler(options);
function Crawler () {
var self = this;
var context;
if (!(this instanceof Crawler)) {
// enforce instantiation
return new Crawler();
}
Readable.call(this);
this._read = function _read () {
if (!context.file.hasNext() && context.folder.hasNext()) {
// all files has been streamed yet,
// but some directories have not been crawled
var path = context.folder.next();
if (path) {
// wait for directory listing to end
self.pause();
fs.list(context, path, function dirCrawlHandler() {
// reactivate crawler
self.resume();
});
}
}
if (!context.file.hasNext() && !this._readableState.buffer.length) {
console.log('- CRAWL END');
// the end of the directory structure has been reached
var report = {
duration: new Date() - new Date(context.crawlSessionTime())
};
Readable.call(this, options);
if (context.file.all().length) {
report.data = context.file.all();
}
if (typeof options.maxDepth !== 'number') {
options.maxDepth = 0;
self.emit('end', report);
}
else if (context.file.hasNext()) {
// emit next file stats
var stats = context.file.next();
var directoryPointer = 0;
var filepathPointer = 0;
self.push(JSON.stringify(stats));
}
};
// private crawler context
var context = Context.get(options);
this._readSync = function _readSync () {
this.hasNextDirectory = function hasNextDirectory () {
return directoryPointer < context.directories.length;
};
while (context.folder.hasNext()) {
// all files has been streamed yet,
// but some directories have not been crawled
var path = context.folder.next();
this.hasNextFilepath = function hasNextFilepath () {
return filepathPointer < context.filepaths.length;
};
if (path) {
fs.list(context, path, function dirCrawlHandler() {
// reactivate crawler
});
}
}
var self = this;
// emit all files stats
return context.file.all();
};
this.restart = function restart (delay) {
delay = (typeof delay === 'number' ? delay : 1000);
this.crawlTree = function crawlTree (absolutPath, options) {
options = Options.validateTreeOptions(options);
options.crawlMode = Options.CRAWL_TREE_MODE;
options.transmissionMode = Options.TRANSMISSION_ASYNC_MODE;
options.root = absolutPath;
setTimeout(function delayedRestart () {
directoryPointer = 0;
filepathPointer = 0;
context = Context.get(options);
context = new Context(options);
self._read();
}, delay);
};
self._read();
self.resume();
this._read = function _read () {
return self;
};
if (!this.hasNextFilepath() && this.hasNextDirectory() && (options.maxDepth === 0 || context.depthPointer < options.maxDepth)) {
this.crawlTreeSync = function crawlTreeSync (absolutPath, options) {
options = Options.validateTreeOptions(options);
options.crawlMode = Options.CRAWL_TREE_MODE;
options.transmissionMode = Options.TRANSMISSION_SYNC_MODE;
options.root = absolutPath;
// all files has been streamed yet,
// but some directories have not been crawled
var path = context.directories[directoryPointer];
directoryPointer += 1;
context = new Context(options);
// wait for directory listing to end
this.pause();
return self._readSync();
};
fs.list(context, path, function dirCrawlHandler () {
// reactivate crawler
self.resume();
});
}
if (!this.hasNextFilepath() && !this._readableState.buffer.length) {
// the end of the directory structure has been reached
var report = {
duration: new Date() - new Date(context.crawlTimestamp)
};
this.crawlPath = function crawlPath (absolutPath, options) {
options = Options.validateTreeOptions(options);
options.crawlMode = Options.CRAWL_PATH_MODE;
options.transmissionMode = Options.TRANSMISSION_ASYNC_MODE;
options.root = absolutPath;
if (options.flushOnEnd) {
// add crawled files to report
report.files = context.filestats;
}
context = new Context(options);
this.emit('end', report);
}
else {
// emit next filestats
var filepath = context.filepaths[filepathPointer];
var stats = JSON.stringify(context.filestats[filepath]);
filepathPointer += 1;
self._read();
self.resume();
this.push(stats);
}
};
return self;
};
this.crawlPathSync = function crawlPathSync (absolutPath, options) {
options = Options.validateTreeOptions(options);
options.crawlMode = Options.CRAWL_PATH_MODE;
options.transmissionMode = Options.TRANSMISSION_SYNC_MODE;
options.root = absolutPath;
context = new Context(options);
return self._readSync();
};
}
module.exports = Crawler;

@@ -6,46 +6,77 @@ 'use strict';

exports.list = function list (context, dirpath, callback) {
var depth = context.depths;
exports.formatStats = function formatStats (absolutePath, rawStats, crawlSessionTime, folderId) {
var stats = {
name: path.basename(absolutePath),
path: absolutePath,
folderId: folderId,
crawlSessionTime: crawlSessionTime
};
if (context.depths.indexOf(dirpath) < 0) {
// directory path is not part of this depth
// starting crawling of new depth
depth = [];
context.depths.push(depth);
context.depthPointer += 1;
if (rawStats) {
if (rawStats instanceof Error) {
stats.error = rawStats;
}
else {
stats.stats = rawStats;
stats.is = {
directory: rawStats.isDirectory(),
blockDevice: rawStats.isBlockDevice(),
characterDevice: rawStats.isCharacterDevice(),
FIFO: rawStats.isFIFO(),
socket: rawStats.isSocket(),
link: rawStats.isSymbolicLink()
};
}
}
var folders = fs.readdirSync(dirpath);
return stats;
};
exports.stats = function stats (context, absolutePath, callback) {
var fileStats = null;
var stats = null;
if (!context.ignoreStats()) {
try {
stats = fs.lstatSync(absolutePath);
if (stats.isDirectory() && context.isTreeMode()) {
// directories found on the actual depth
// are part of the next depth's directories
context.folder.add(absolutePath);
}
fileStats = exports.formatStats(absolutePath, stats, context.crawlSessionTime(), context.folderId());
if (fileStats.is.link) {
var info = exports.getSymlinkInfo(absolutePath);
fileStats.targetPath = info.target;
fileStats.targetStats = info.stats || null;
}
}
catch (error) {
stats = error;
}
}
fileStats = exports.formatStats(absolutePath, stats, context.crawlSessionTime(), context.folderId());
return fileStats;
};
exports.list = function list (context, dirpath, callback) {
var files = fs.readdirSync(dirpath);
var content = {};
folders.forEach(function folderIterator (name) {
files.forEach(function folderIterator (name) {
var absolutePath = dirpath + path.sep + name;
var stats = fs.lstatSync(absolutePath);
if (stats.isDirectory()) {
depth.push(absolutePath);
context.directories.push(absolutePath);
}
if (exports.filter(context.filters(), absolutePath)) {
var fileStats = exports.stats(context, absolutePath);
context.filepaths.push(absolutePath);
context.filestats[absolutePath] = {
path: absolutePath,
crawlTimestamp: context.crawlTimestamp,
stats: stats,
isDirectory: stats.isDirectory(),
isBlockDevice: stats.isBlockDevice(),
isCharacterDevice: stats.isCharacterDevice(),
isFIFO: stats.isFIFO(),
isSocket: stats.isSocket(),
isLink: stats.isSymbolicLink()
};
context.file.add(fileStats);
if (context.filestats[absolutePath].isSymbolicLink) {
var info = exports.getSymlinkInfo(absolutePath);
context.filestats[absolutePath].links = info.links;
context.filestats[absolutePath].isBroken = info.isBroken;
content[absolutePath] = fileStats;
}
content[absolutePath] = context.filestats[absolutePath];
});

@@ -60,11 +91,12 @@

var info = {
links: targetpath
target: targetpath
};
try {
info.stats = fs.lstatSync(linkpath);
info.isBroken = false;
info.stats = fs.lstatSync(targetpath);
}
catch (linkException) {
info.isBroken = true;
if (linkException.code !== 'ENOENT') {
throw linkException;
}
}

@@ -74,1 +106,31 @@

};
exports.filter = function filter (filters, absolutePath) {
var valid = false;
if (filters) {
var index = filters.length;
while (index--) {
var currentFilter = filters[index];
if (typeof currentFilter === 'string') {
// converting file extension string to a regular expression
currentFilter = new RegExp('\.*\\.' + currentFilter + '$');
}
valid = currentFilter.test(absolutePath);
if (valid) {
// one filter is valid: no need to continue checking
break;
}
}
}
else {
// no filters defined: everything is valid
valid = true;
}
return valid;
};
{
"name": "fs-crawler",
"license": "MIT",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/luscus/fs-crawler",

@@ -18,11 +18,5 @@ "author": "https://github.com/luscus/fs-crawler/graphs/contributors",

"chai": "^3.4.1",
"devmode": "^1.0.1",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-jsdoc-to-markdown": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-util": "^3.0.6",
"gulpfile.basics": "^0.0.3",
"mocha": "^2.3.4",
"pem": "^1.8.1"
"gulpfile.basics": "^0",
"mocha": "^2.3.4"
},

@@ -29,0 +23,0 @@ "repository": {

@@ -14,44 +14,44 @@ # fs-crawler

## Installation
## Configuration Options
### Node Dependencies
### Common
Execute following line
* `maxDepth` {number}: max number of folder depth to be crawled to
* `noStats` {boolean}: no file statistics will be retrieved - sparing I/O - only absolute path will be returned
* `filters` {string[]|regex[]}: a mixed array of file extension strings or regular expressions applied against every found file path
npm install fs-crawler --save
### ASYNC Mode Specific
### Require module
* `flushOnEnd` {boolean}: returns all the data at the end of the stream
var Crawler = require('fs-crawler');
var options = {
root: '/some/absolut/path/to/directory',
flushOnEnd: true, // all found filesystem elements are returned on 'end'
maxDepth: 0 // max subdirectory depth for crawling, 0 = infinity
};
var crawler = new Crawler(options);
crawler.setEncoding('utf8'); // String wanted not Buffer
crawler.on('data', function (data) {
// information about a file or a directory
console.log(data);
});
crawler.on('end', function (data) {
// returns crawl duration in milliseconds
// and optionally the found elements
console.log(data);
// recrawls the filesystem using the same options
crawler.restart(2000);
});
// start streaming
crawler.resume();
### Path Mode Specific
* `reverse` {boolean}: path will be traversed from `maxDepth` to `root`
## Usage
### match, matchInRoot, matchInExternal
### Installation
```bash
npm install fs-crawler --save
```
### Require module
```javascript
var Crawler = require('fs-crawler');
var options = {
reverse: true,
noStats: false,
filters: ['txt'],
maxDepth: 4
};
var crawler = new Crawler();
var results = crawler.crawlTreeSync(testRoot, options);
```
-------------------

@@ -58,0 +58,0 @@ Copyright (c) 2016 Luscus (luscus.redbeard@gmail.com)

{
"/media/nysos/NYSOS/dev/fs-crawler/lib/fs-crawler.js":{"path":"/media/nysos/NYSOS/dev/fs-crawler/lib/fs-crawler.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":0,"9":1,"10":1,"11":0,"12":1,"13":1,"14":1,"15":1,"16":4,"17":1,"18":12,"19":1,"20":1,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":1,"28":6,"29":2,"30":2,"31":2,"32":2,"33":2,"34":6,"35":1,"36":1,"37":0,"38":1,"39":5,"40":5,"41":5,"42":5,"43":1},"b":{"1":[0,1],"2":[0,1],"3":[0,0],"4":[2,4],"5":[6,4,2,0],"6":[1,5],"7":[6,2],"8":[0,1]},"f":{"1":1,"2":4,"3":12,"4":0,"5":0,"6":6,"7":2},"fnMap":{"1":{"name":"Crawler","line":11,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}}},"2":{"name":"hasNextDirectory","line":28,"loc":{"start":{"line":28,"column":28},"end":{"line":28,"column":57}}},"3":{"name":"hasNextFilepath","line":32,"loc":{"start":{"line":32,"column":27},"end":{"line":32,"column":55}}},"4":{"name":"restart","line":38,"loc":{"start":{"line":38,"column":19},"end":{"line":38,"column":44}}},"5":{"name":"delayedRestart","line":41,"loc":{"start":{"line":41,"column":23},"end":{"line":41,"column":50}}},"6":{"name":"_read","line":50,"loc":{"start":{"line":50,"column":17},"end":{"line":50,"column":35}}},"7":{"name":"dirCrawlHandler","line":62,"loc":{"start":{"line":62,"column":35},"end":{"line":62,"column":63}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":42}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":42}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":33}},"6":{"start":{"line":11,"column":0},"end":{"line":89,"column":1}},"7":{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},"8":{"start":{"line":13,"column":8},"end":{"line":13,"column":36}},"9":{"start":{"line":16,"column":4},"end":{"line":16,"column":33}},"10":{"start":{"line":18,"column":4},"end":{"line":20,"column":5}},"11":{"start":{"line":19,"column":8},"end":{"line":19,"column":29}},"12":{"start":{"line":22,"column":4},"end":{"line":22,"column":29}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":29}},"14":{"start":{"line":26,"column":4},"end":{"line":26,"column":48}},"15":{"start":{"line":28,"column":4},"end":{"line":30,"column":6}},"16":{"start":{"line":29,"column":8},"end":{"line":29,"column":61}},"17":{"start":{"line":32,"column":4},"end":{"line":34,"column":6}},"18":{"start":{"line":33,"column":8},"end":{"line":33,"column":58}},"19":{"start":{"line":36,"column":4},"end":{"line":36,"column":20}},"20":{"start":{"line":38,"column":4},"end":{"line":48,"column":6}},"21":{"start":{"line":39,"column":8},"end":{"line":39,"column":59}},"22":{"start":{"line":41,"column":12},"end":{"line":47,"column":22}},"23":{"start":{"line":42,"column":16},"end":{"line":42,"column":37}},"24":{"start":{"line":43,"column":16},"end":{"line":43,"column":36}},"25":{"start":{"line":44,"column":16},"end":{"line":44,"column":47}},"26":{"start":{"line":46,"column":16},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":4},"end":{"line":88,"column":6}},"28":{"start":{"line":52,"column":8},"end":{"line":66,"column":9}},"29":{"start":{"line":56,"column":12},"end":{"line":56,"column":61}},"30":{"start":{"line":57,"column":12},"end":{"line":57,"column":34}},"31":{"start":{"line":60,"column":12},"end":{"line":60,"column":25}},"32":{"start":{"line":62,"column":12},"end":{"line":65,"column":15}},"33":{"start":{"line":64,"column":16},"end":{"line":64,"column":30}},"34":{"start":{"line":67,"column":8},"end":{"line":87,"column":9}},"35":{"start":{"line":69,"column":12},"end":{"line":71,"column":14}},"36":{"start":{"line":73,"column":12},"end":{"line":76,"column":13}},"37":{"start":{"line":75,"column":16},"end":{"line":75,"column":49}},"38":{"start":{"line":78,"column":12},"end":{"line":78,"column":37}},"39":{"start":{"line":82,"column":12},"end":{"line":82,"column":62}},"40":{"start":{"line":83,"column":12},"end":{"line":83,"column":71}},"41":{"start":{"line":84,"column":12},"end":{"line":84,"column":33}},"42":{"start":{"line":86,"column":12},"end":{"line":86,"column":29}},"43":{"start":{"line":91,"column":0},"end":{"line":91,"column":25}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":4}},{"start":{"line":12,"column":4},"end":{"line":12,"column":4}}]},"2":{"line":18,"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":18,"column":4}},{"start":{"line":18,"column":4},"end":{"line":18,"column":4}}]},"3":{"line":39,"type":"cond-expr","locations":[{"start":{"line":39,"column":45},"end":{"line":39,"column":50}},{"start":{"line":39,"column":53},"end":{"line":39,"column":57}}]},"4":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]},"5":{"line":52,"type":"binary-expr","locations":[{"start":{"line":52,"column":12},"end":{"line":52,"column":35}},{"start":{"line":52,"column":39},"end":{"line":52,"column":62}},{"start":{"line":52,"column":67},"end":{"line":52,"column":89}},{"start":{"line":52,"column":93},"end":{"line":52,"column":132}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"7":{"line":67,"type":"binary-expr","locations":[{"start":{"line":67,"column":12},"end":{"line":67,"column":35}},{"start":{"line":67,"column":39},"end":{"line":67,"column":73}}]},"8":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":12},"end":{"line":73,"column":12}},{"start":{"line":73,"column":12},"end":{"line":73,"column":12}}]}},"l":{"3":1,"4":1,"5":1,"6":1,"9":1,"11":1,"12":1,"13":0,"16":1,"18":1,"19":0,"22":1,"23":1,"26":1,"28":1,"29":4,"32":1,"33":12,"36":1,"38":1,"39":0,"41":0,"42":0,"43":0,"44":0,"46":0,"50":1,"52":6,"56":2,"57":2,"60":2,"62":2,"64":2,"67":6,"69":1,"73":1,"75":0,"78":1,"82":5,"83":5,"84":5,"86":5,"91":1}},
"/media/nysos/NYSOS/dev/fs-crawler/lib/tools/context.js":{"path":"/media/nysos/NYSOS/dev/fs-crawler/lib/tools/context.js","s":{"1":1,"2":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"get","line":3,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":37}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":12,"column":2}},"2":{"start":{"line":4,"column":4},"end":{"line":11,"column":6}}},"branchMap":{},"l":{"3":1,"4":1}},
"/media/nysos/NYSOS/dev/fs-crawler/lib/tools/fs.js":{"path":"/media/nysos/NYSOS/dev/fs-crawler/lib/tools/fs.js","s":{"1":1,"2":1,"3":1,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":4,"13":4,"14":4,"15":1,"16":1,"17":4,"18":4,"19":4,"20":0,"21":0,"22":0,"23":4,"24":2,"25":1,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0},"b":{"1":[2,0],"2":[1,3],"3":[0,4]},"f":{"1":2,"2":4,"3":0},"fnMap":{"1":{"name":"list","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":58}}},"2":{"name":"folderIterator","line":20,"loc":{"start":{"line":20,"column":18},"end":{"line":20,"column":49}}},"3":{"name":"getSymlinkInfo","line":56,"loc":{"start":{"line":56,"column":25},"end":{"line":56,"column":60}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":25}},"3":{"start":{"line":6,"column":0},"end":{"line":54,"column":2}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":29}},"5":{"start":{"line":9,"column":2},"end":{"line":15,"column":3}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":30}},"7":{"start":{"line":13,"column":4},"end":{"line":13,"column":31}},"8":{"start":{"line":14,"column":4},"end":{"line":14,"column":30}},"9":{"start":{"line":17,"column":2},"end":{"line":17,"column":40}},"10":{"start":{"line":18,"column":2},"end":{"line":18,"column":19}},"11":{"start":{"line":20,"column":2},"end":{"line":50,"column":5}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":49}},"13":{"start":{"line":22,"column":4},"end":{"line":22,"column":43}},"14":{"start":{"line":24,"column":4},"end":{"line":27,"column":5}},"15":{"start":{"line":25,"column":6},"end":{"line":25,"column":31}},"16":{"start":{"line":26,"column":6},"end":{"line":26,"column":45}},"17":{"start":{"line":29,"column":4},"end":{"line":29,"column":41}},"18":{"start":{"line":30,"column":4},"end":{"line":40,"column":6}},"19":{"start":{"line":42,"column":4},"end":{"line":47,"column":5}},"20":{"start":{"line":43,"column":6},"end":{"line":43,"column":54}},"21":{"start":{"line":45,"column":6},"end":{"line":45,"column":60}},"22":{"start":{"line":46,"column":6},"end":{"line":46,"column":63}},"23":{"start":{"line":49,"column":4},"end":{"line":49,"column":60}},"24":{"start":{"line":53,"column":2},"end":{"line":53,"column":20}},"25":{"start":{"line":56,"column":0},"end":{"line":71,"column":2}},"26":{"start":{"line":57,"column":2},"end":{"line":57,"column":46}},"27":{"start":{"line":58,"column":2},"end":{"line":60,"column":4}},"28":{"start":{"line":62,"column":2},"end":{"line":68,"column":3}},"29":{"start":{"line":63,"column":4},"end":{"line":63,"column":40}},"30":{"start":{"line":64,"column":4},"end":{"line":64,"column":26}},"31":{"start":{"line":67,"column":4},"end":{"line":67,"column":25}},"32":{"start":{"line":70,"column":2},"end":{"line":70,"column":14}}},"branchMap":{"1":{"line":9,"type":"if","locations":[{"start":{"line":9,"column":2},"end":{"line":9,"column":2}},{"start":{"line":9,"column":2},"end":{"line":9,"column":2}}]},"2":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"3":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]}},"l":{"3":1,"4":1,"6":1,"7":2,"9":2,"12":2,"13":2,"14":2,"17":2,"18":2,"20":2,"21":4,"22":4,"24":4,"25":1,"26":1,"29":4,"30":4,"42":4,"43":0,"45":0,"46":0,"49":4,"53":2,"56":1,"57":0,"58":0,"62":0,"63":0,"64":0,"67":0,"70":0}}}
"/home/nysos/dev/fs-crawler/lib/fs-crawler.js":{"path":"/home/nysos/dev/fs-crawler/lib/fs-crawler.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":0,"12":1,"13":1,"14":2,"15":0,"16":0,"17":0,"18":0,"19":0,"20":2,"21":0,"22":0,"23":0,"24":0,"25":0,"26":2,"27":1,"28":1,"29":1,"30":1,"31":2,"32":2,"33":1,"34":1,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":1,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":1},"b":{"1":[0,1],"2":[0,2],"3":[2,1],"4":[0,0],"5":[0,2],"6":[2,1],"7":[0,0],"8":[1,1],"9":[1,1]},"f":{"1":1,"2":2,"3":0,"4":1,"5":1,"6":0,"7":1,"8":0,"9":0},"fnMap":{"1":{"name":"Crawler","line":12,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":20}}},"2":{"name":"_read","line":23,"loc":{"start":{"line":23,"column":15},"end":{"line":23,"column":33}}},"3":{"name":"dirCrawlHandler","line":35,"loc":{"start":{"line":35,"column":31},"end":{"line":35,"column":58}}},"4":{"name":"_readSync","line":62,"loc":{"start":{"line":62,"column":19},"end":{"line":62,"column":41}}},"5":{"name":"dirCrawlHandler","line":70,"loc":{"start":{"line":70,"column":31},"end":{"line":70,"column":58}}},"6":{"name":"crawlTree","line":80,"loc":{"start":{"line":80,"column":19},"end":{"line":80,"column":61}}},"7":{"name":"crawlTreeSync","line":94,"loc":{"start":{"line":94,"column":23},"end":{"line":94,"column":69}}},"8":{"name":"crawlPath","line":105,"loc":{"start":{"line":105,"column":19},"end":{"line":105,"column":61}}},"9":{"name":"crawlPathSync","line":119,"loc":{"start":{"line":119,"column":23},"end":{"line":119,"column":69}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":46}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":40}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":46}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":41}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}},"7":{"start":{"line":12,"column":0},"end":{"line":129,"column":1}},"8":{"start":{"line":13,"column":2},"end":{"line":13,"column":18}},"9":{"start":{"line":14,"column":2},"end":{"line":14,"column":14}},"10":{"start":{"line":16,"column":2},"end":{"line":19,"column":3}},"11":{"start":{"line":18,"column":4},"end":{"line":18,"column":25}},"12":{"start":{"line":21,"column":2},"end":{"line":21,"column":22}},"13":{"start":{"line":23,"column":2},"end":{"line":60,"column":4}},"14":{"start":{"line":25,"column":4},"end":{"line":40,"column":5}},"15":{"start":{"line":29,"column":6},"end":{"line":29,"column":39}},"16":{"start":{"line":31,"column":6},"end":{"line":39,"column":7}},"17":{"start":{"line":33,"column":8},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":8},"end":{"line":38,"column":11}},"19":{"start":{"line":37,"column":10},"end":{"line":37,"column":24}},"20":{"start":{"line":41,"column":4},"end":{"line":59,"column":5}},"21":{"start":{"line":42,"column":6},"end":{"line":42,"column":33}},"22":{"start":{"line":44,"column":6},"end":{"line":46,"column":8}},"23":{"start":{"line":48,"column":6},"end":{"line":50,"column":7}},"24":{"start":{"line":49,"column":8},"end":{"line":49,"column":41}},"25":{"start":{"line":52,"column":6},"end":{"line":52,"column":31}},"26":{"start":{"line":54,"column":9},"end":{"line":59,"column":5}},"27":{"start":{"line":56,"column":6},"end":{"line":56,"column":38}},"28":{"start":{"line":58,"column":6},"end":{"line":58,"column":39}},"29":{"start":{"line":62,"column":2},"end":{"line":78,"column":4}},"30":{"start":{"line":64,"column":4},"end":{"line":74,"column":5}},"31":{"start":{"line":67,"column":6},"end":{"line":67,"column":39}},"32":{"start":{"line":69,"column":6},"end":{"line":73,"column":7}},"33":{"start":{"line":70,"column":8},"end":{"line":72,"column":11}},"34":{"start":{"line":77,"column":4},"end":{"line":77,"column":30}},"35":{"start":{"line":80,"column":2},"end":{"line":92,"column":4}},"36":{"start":{"line":81,"column":4},"end":{"line":81,"column":61}},"37":{"start":{"line":82,"column":4},"end":{"line":82,"column":48}},"38":{"start":{"line":83,"column":4},"end":{"line":83,"column":63}},"39":{"start":{"line":84,"column":4},"end":{"line":84,"column":36}},"40":{"start":{"line":86,"column":4},"end":{"line":86,"column":35}},"41":{"start":{"line":88,"column":4},"end":{"line":88,"column":17}},"42":{"start":{"line":89,"column":4},"end":{"line":89,"column":18}},"43":{"start":{"line":91,"column":4},"end":{"line":91,"column":16}},"44":{"start":{"line":94,"column":2},"end":{"line":103,"column":4}},"45":{"start":{"line":95,"column":4},"end":{"line":95,"column":61}},"46":{"start":{"line":96,"column":4},"end":{"line":96,"column":48}},"47":{"start":{"line":97,"column":4},"end":{"line":97,"column":62}},"48":{"start":{"line":98,"column":4},"end":{"line":98,"column":36}},"49":{"start":{"line":100,"column":4},"end":{"line":100,"column":35}},"50":{"start":{"line":102,"column":4},"end":{"line":102,"column":28}},"51":{"start":{"line":105,"column":2},"end":{"line":117,"column":4}},"52":{"start":{"line":106,"column":4},"end":{"line":106,"column":61}},"53":{"start":{"line":107,"column":4},"end":{"line":107,"column":48}},"54":{"start":{"line":108,"column":4},"end":{"line":108,"column":63}},"55":{"start":{"line":109,"column":4},"end":{"line":109,"column":36}},"56":{"start":{"line":111,"column":4},"end":{"line":111,"column":35}},"57":{"start":{"line":113,"column":4},"end":{"line":113,"column":17}},"58":{"start":{"line":114,"column":4},"end":{"line":114,"column":18}},"59":{"start":{"line":116,"column":4},"end":{"line":116,"column":16}},"60":{"start":{"line":119,"column":2},"end":{"line":128,"column":4}},"61":{"start":{"line":120,"column":4},"end":{"line":120,"column":61}},"62":{"start":{"line":121,"column":4},"end":{"line":121,"column":48}},"63":{"start":{"line":122,"column":4},"end":{"line":122,"column":62}},"64":{"start":{"line":123,"column":4},"end":{"line":123,"column":36}},"65":{"start":{"line":125,"column":4},"end":{"line":125,"column":35}},"66":{"start":{"line":127,"column":4},"end":{"line":127,"column":28}},"67":{"start":{"line":131,"column":0},"end":{"line":131,"column":25}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":2},"end":{"line":16,"column":2}},{"start":{"line":16,"column":2},"end":{"line":16,"column":2}}]},"2":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":4},"end":{"line":25,"column":4}},{"start":{"line":25,"column":4},"end":{"line":25,"column":4}}]},"3":{"line":25,"type":"binary-expr","locations":[{"start":{"line":25,"column":8},"end":{"line":25,"column":31}},{"start":{"line":25,"column":35},"end":{"line":25,"column":59}}]},"4":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":6},"end":{"line":31,"column":6}},{"start":{"line":31,"column":6},"end":{"line":31,"column":6}}]},"5":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"6":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":8},"end":{"line":41,"column":31}},{"start":{"line":41,"column":35},"end":{"line":41,"column":69}}]},"7":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":48,"column":6}},{"start":{"line":48,"column":6},"end":{"line":48,"column":6}}]},"8":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":9},"end":{"line":54,"column":9}},{"start":{"line":54,"column":9},"end":{"line":54,"column":9}}]},"9":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":6},"end":{"line":69,"column":6}},{"start":{"line":69,"column":6},"end":{"line":69,"column":6}}]}},"l":{"3":1,"4":1,"5":1,"6":1,"7":1,"10":1,"12":1,"13":1,"14":1,"16":1,"18":0,"21":1,"23":1,"25":2,"29":0,"31":0,"33":0,"35":0,"37":0,"41":2,"42":0,"44":0,"48":0,"49":0,"52":0,"54":2,"56":1,"58":1,"62":1,"64":1,"67":2,"69":2,"70":1,"77":1,"80":1,"81":0,"82":0,"83":0,"84":0,"86":0,"88":0,"89":0,"91":0,"94":1,"95":1,"96":1,"97":1,"98":1,"100":1,"102":1,"105":1,"106":0,"107":0,"108":0,"109":0,"111":0,"113":0,"114":0,"116":0,"119":1,"120":0,"121":0,"122":0,"123":0,"125":0,"127":0,"131":1}},
"/home/nysos/dev/fs-crawler/lib/Context.js":{"path":"/home/nysos/dev/fs-crawler/lib/Context.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":5,"15":1,"16":1,"17":1,"18":0,"19":1,"20":1,"21":1,"22":2,"23":1,"24":2,"25":1,"26":2,"27":1,"28":5,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":1,"37":7,"38":3,"39":1,"40":2,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":0,"50":0,"51":1,"52":7,"53":1,"54":0,"55":1,"56":1,"57":1,"58":1,"59":1,"60":1,"61":1,"62":1},"b":{"1":[1,0],"2":[5,0],"3":[2,0],"4":[5,2],"5":[0,0],"6":[0,0],"7":[7,4,5],"8":[1,2],"9":[1,1],"10":[0,0],"11":[0,1],"12":[1,0],"13":[1,0]},"f":{"1":1,"2":5,"3":1,"4":0,"5":1,"6":2,"7":2,"8":2,"9":5,"10":0,"11":0,"12":7,"13":3,"14":0,"15":7,"16":1,"17":1,"18":1},"fnMap":{"1":{"name":"Context","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":27}}},"2":{"name":"(anonymous_2)","line":22,"loc":{"start":{"line":22,"column":17},"end":{"line":22,"column":29}}},"3":{"name":"(anonymous_3)","line":26,"loc":{"start":{"line":26,"column":21},"end":{"line":26,"column":33}}},"4":{"name":"(anonymous_4)","line":30,"loc":{"start":{"line":30,"column":20},"end":{"line":30,"column":32}}},"5":{"name":"(anonymous_5)","line":34,"loc":{"start":{"line":34,"column":20},"end":{"line":34,"column":32}}},"6":{"name":"(anonymous_6)","line":38,"loc":{"start":{"line":38,"column":27},"end":{"line":38,"column":39}}},"7":{"name":"(anonymous_7)","line":42,"loc":{"start":{"line":42,"column":26},"end":{"line":42,"column":38}}},"8":{"name":"(anonymous_8)","line":46,"loc":{"start":{"line":46,"column":18},"end":{"line":46,"column":30}}},"9":{"name":"(anonymous_9)","line":54,"loc":{"start":{"line":54,"column":13},"end":{"line":54,"column":25}}},"10":{"name":"(anonymous_10)","line":57,"loc":{"start":{"line":57,"column":10},"end":{"line":57,"column":22}}},"11":{"name":"(anonymous_11)","line":74,"loc":{"start":{"line":74,"column":13},"end":{"line":74,"column":25}}},"12":{"name":"(anonymous_12)","line":80,"loc":{"start":{"line":80,"column":13},"end":{"line":80,"column":25}}},"13":{"name":"(anonymous_13)","line":86,"loc":{"start":{"line":86,"column":10},"end":{"line":86,"column":22}}},"14":{"name":"(anonymous_14)","line":111,"loc":{"start":{"line":111,"column":9},"end":{"line":111,"column":31}}},"15":{"name":"(anonymous_15)","line":119,"loc":{"start":{"line":119,"column":13},"end":{"line":119,"column":25}}},"16":{"name":"(anonymous_16)","line":122,"loc":{"start":{"line":122,"column":10},"end":{"line":122,"column":22}}},"17":{"name":"(anonymous_17)","line":133,"loc":{"start":{"line":133,"column":9},"end":{"line":133,"column":21}}},"18":{"name":"(anonymous_18)","line":136,"loc":{"start":{"line":136,"column":9},"end":{"line":136,"column":26}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":41}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}},"3":{"start":{"line":6,"column":0},"end":{"line":144,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":28}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":48}},"6":{"start":{"line":10,"column":2},"end":{"line":10,"column":25}},"7":{"start":{"line":11,"column":2},"end":{"line":11,"column":25}},"8":{"start":{"line":12,"column":2},"end":{"line":12,"column":25}},"9":{"start":{"line":13,"column":2},"end":{"line":13,"column":25}},"10":{"start":{"line":14,"column":2},"end":{"line":14,"column":26}},"11":{"start":{"line":15,"column":2},"end":{"line":15,"column":26}},"12":{"start":{"line":17,"column":2},"end":{"line":20,"column":4}},"13":{"start":{"line":22,"column":2},"end":{"line":24,"column":4}},"14":{"start":{"line":23,"column":4},"end":{"line":23,"column":33}},"15":{"start":{"line":26,"column":2},"end":{"line":28,"column":4}},"16":{"start":{"line":27,"column":4},"end":{"line":27,"column":38}},"17":{"start":{"line":30,"column":2},"end":{"line":32,"column":4}},"18":{"start":{"line":31,"column":4},"end":{"line":31,"column":59}},"19":{"start":{"line":34,"column":2},"end":{"line":36,"column":4}},"20":{"start":{"line":35,"column":4},"end":{"line":35,"column":73}},"21":{"start":{"line":38,"column":2},"end":{"line":40,"column":4}},"22":{"start":{"line":39,"column":4},"end":{"line":39,"column":74}},"23":{"start":{"line":42,"column":2},"end":{"line":44,"column":4}},"24":{"start":{"line":43,"column":4},"end":{"line":43,"column":26}},"25":{"start":{"line":46,"column":2},"end":{"line":51,"column":4}},"26":{"start":{"line":47,"column":4},"end":{"line":50,"column":6}},"27":{"start":{"line":53,"column":2},"end":{"line":77,"column":4}},"28":{"start":{"line":55,"column":6},"end":{"line":55,"column":71}},"29":{"start":{"line":59,"column":6},"end":{"line":61,"column":7}},"30":{"start":{"line":60,"column":8},"end":{"line":60,"column":20}},"31":{"start":{"line":63,"column":6},"end":{"line":63,"column":40}},"32":{"start":{"line":65,"column":6},"end":{"line":70,"column":7}},"33":{"start":{"line":69,"column":8},"end":{"line":69,"column":24}},"34":{"start":{"line":72,"column":6},"end":{"line":72,"column":36}},"35":{"start":{"line":75,"column":6},"end":{"line":75,"column":34}},"36":{"start":{"line":79,"column":2},"end":{"line":116,"column":4}},"37":{"start":{"line":81,"column":6},"end":{"line":84,"column":8}},"38":{"start":{"line":88,"column":6},"end":{"line":90,"column":7}},"39":{"start":{"line":89,"column":8},"end":{"line":89,"column":20}},"40":{"start":{"line":92,"column":6},"end":{"line":100,"column":7}},"41":{"start":{"line":95,"column":8},"end":{"line":95,"column":26}},"42":{"start":{"line":97,"column":8},"end":{"line":97,"column":26}},"43":{"start":{"line":99,"column":8},"end":{"line":99,"column":34}},"44":{"start":{"line":103,"column":6},"end":{"line":103,"column":24}},"45":{"start":{"line":104,"column":6},"end":{"line":104,"column":25}},"46":{"start":{"line":106,"column":6},"end":{"line":106,"column":55}},"47":{"start":{"line":107,"column":6},"end":{"line":107,"column":25}},"48":{"start":{"line":109,"column":6},"end":{"line":109,"column":20}},"49":{"start":{"line":112,"column":6},"end":{"line":114,"column":7}},"50":{"start":{"line":113,"column":8},"end":{"line":113,"column":43}},"51":{"start":{"line":118,"column":2},"end":{"line":143,"column":4}},"52":{"start":{"line":120,"column":6},"end":{"line":120,"column":40}},"53":{"start":{"line":124,"column":6},"end":{"line":126,"column":7}},"54":{"start":{"line":125,"column":8},"end":{"line":125,"column":20}},"55":{"start":{"line":128,"column":6},"end":{"line":128,"column":40}},"56":{"start":{"line":129,"column":6},"end":{"line":129,"column":23}},"57":{"start":{"line":131,"column":6},"end":{"line":131,"column":18}},"58":{"start":{"line":134,"column":6},"end":{"line":134,"column":22}},"59":{"start":{"line":137,"column":6},"end":{"line":137,"column":24}},"60":{"start":{"line":139,"column":6},"end":{"line":141,"column":7}},"61":{"start":{"line":140,"column":8},"end":{"line":140,"column":29}},"62":{"start":{"line":146,"column":0},"end":{"line":146,"column":25}}},"branchMap":{"1":{"line":17,"type":"cond-expr","locations":[{"start":{"line":18,"column":6},"end":{"line":18,"column":22}},{"start":{"line":19,"column":6},"end":{"line":19,"column":75}}]},"2":{"line":23,"type":"binary-expr","locations":[{"start":{"line":23,"column":11},"end":{"line":23,"column":26}},{"start":{"line":23,"column":30},"end":{"line":23,"column":32}}]},"3":{"line":39,"type":"cond-expr","locations":[{"start":{"line":39,"column":31},"end":{"line":39,"column":64}},{"start":{"line":39,"column":67},"end":{"line":39,"column":72}}]},"4":{"line":55,"type":"binary-expr","locations":[{"start":{"line":55,"column":13},"end":{"line":55,"column":41}},{"start":{"line":55,"column":45},"end":{"line":55,"column":70}}]},"5":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":6},"end":{"line":59,"column":6}},{"start":{"line":59,"column":6},"end":{"line":59,"column":6}}]},"6":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":6},"end":{"line":65,"column":6}},{"start":{"line":65,"column":6},"end":{"line":65,"column":6}}]},"7":{"line":82,"type":"binary-expr","locations":[{"start":{"line":82,"column":9},"end":{"line":82,"column":29}},{"start":{"line":82,"column":33},"end":{"line":82,"column":76}},{"start":{"line":83,"column":8},"end":{"line":83,"column":28}}]},"8":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":6},"end":{"line":88,"column":6}},{"start":{"line":88,"column":6},"end":{"line":88,"column":6}}]},"9":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":6},"end":{"line":92,"column":6}},{"start":{"line":92,"column":6},"end":{"line":92,"column":6}}]},"10":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":6},"end":{"line":112,"column":6}},{"start":{"line":112,"column":6},"end":{"line":112,"column":6}}]},"11":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":6},"end":{"line":124,"column":6}},{"start":{"line":124,"column":6},"end":{"line":124,"column":6}}]},"12":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":6},"end":{"line":139,"column":6}},{"start":{"line":139,"column":6},"end":{"line":139,"column":6}}]},"13":{"line":139,"type":"binary-expr","locations":[{"start":{"line":139,"column":10},"end":{"line":139,"column":27}},{"start":{"line":139,"column":31},"end":{"line":139,"column":49}}]}},"l":{"3":1,"4":1,"6":1,"7":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"17":1,"22":1,"23":5,"26":1,"27":1,"30":1,"31":0,"34":1,"35":1,"38":1,"39":2,"42":1,"43":2,"46":1,"47":2,"53":1,"55":5,"59":0,"60":0,"63":0,"65":0,"69":0,"72":0,"75":0,"79":1,"81":7,"88":3,"89":1,"92":2,"95":1,"97":1,"99":1,"103":1,"104":1,"106":1,"107":1,"109":1,"112":0,"113":0,"118":1,"120":7,"124":1,"125":0,"128":1,"129":1,"131":1,"134":1,"137":1,"139":1,"140":1,"146":1}},
"/home/nysos/dev/fs-crawler/lib/tools/options.js":{"path":"/home/nysos/dev/fs-crawler/lib/tools/options.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":0,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1},"b":{"1":[1,0],"2":[0,1],"3":[1,1],"4":[1,0],"5":[1,0]},"f":{"1":1,"2":1},"fnMap":{"1":{"name":"validate","line":8,"loc":{"start":{"line":8,"column":19},"end":{"line":8,"column":47}}},"2":{"name":"validateTreeOptions","line":24,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":69}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":46}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":46}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":47}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":46}},"5":{"start":{"line":8,"column":0},"end":{"line":22,"column":2}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":28}},"7":{"start":{"line":11,"column":4},"end":{"line":14,"column":5}},"8":{"start":{"line":13,"column":8},"end":{"line":13,"column":29}},"9":{"start":{"line":16,"column":4},"end":{"line":19,"column":5}},"10":{"start":{"line":18,"column":8},"end":{"line":18,"column":32}},"11":{"start":{"line":21,"column":4},"end":{"line":21,"column":19}},"12":{"start":{"line":24,"column":0},"end":{"line":29,"column":2}},"13":{"start":{"line":25,"column":4},"end":{"line":25,"column":45}},"14":{"start":{"line":26,"column":4},"end":{"line":26,"column":48}},"15":{"start":{"line":28,"column":4},"end":{"line":28,"column":19}}},"branchMap":{"1":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":14},"end":{"line":9,"column":21}},{"start":{"line":9,"column":25},"end":{"line":9,"column":27}}]},"2":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":25}},{"start":{"line":11,"column":29},"end":{"line":11,"column":65}}]},"4":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"5":{"line":16,"type":"binary-expr","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":24}},{"start":{"line":16,"column":28},"end":{"line":16,"column":64}}]}},"l":{"3":1,"4":1,"5":1,"6":1,"8":1,"9":1,"11":1,"13":0,"16":1,"18":1,"21":1,"24":1,"25":1,"26":1,"28":1}},
"/home/nysos/dev/fs-crawler/lib/tools/path.js":{"path":"/home/nysos/dev/fs-crawler/lib/tools/path.js","s":{"1":1,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"splitIntoDepths","line":5,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":85}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"2":{"start":{"line":5,"column":0},"end":{"line":23,"column":2}},"3":{"start":{"line":6,"column":2},"end":{"line":6,"column":58}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":19}},"5":{"start":{"line":8,"column":2},"end":{"line":8,"column":19}},"6":{"start":{"line":10,"column":2},"end":{"line":20,"column":3}},"7":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"8":{"start":{"line":12,"column":6},"end":{"line":12,"column":50}},"9":{"start":{"line":13,"column":6},"end":{"line":13,"column":20}},"10":{"start":{"line":16,"column":6},"end":{"line":16,"column":44}},"11":{"start":{"line":19,"column":4},"end":{"line":19,"column":27}},"12":{"start":{"line":22,"column":2},"end":{"line":22,"column":16}}},"branchMap":{"1":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":9},"end":{"line":10,"column":23}},{"start":{"line":10,"column":28},"end":{"line":10,"column":71}}]},"2":{"line":10,"type":"cond-expr","locations":[{"start":{"line":10,"column":39},"end":{"line":10,"column":64}},{"start":{"line":10,"column":67},"end":{"line":10,"column":71}}]},"3":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]}},"l":{"3":1,"5":1,"6":0,"7":0,"8":0,"10":0,"11":0,"12":0,"13":0,"16":0,"19":0,"22":0}},
"/home/nysos/dev/fs-crawler/lib/tools/fs.js":{"path":"/home/nysos/dev/fs-crawler/lib/tools/fs.js","s":{"1":1,"2":1,"3":1,"4":2,"5":2,"6":2,"7":0,"8":2,"9":2,"10":2,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":0,"19":1,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":5,"32":5,"33":1,"34":1,"35":1,"36":1,"37":1,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":1,"46":5,"47":5,"48":5,"49":5,"50":5,"51":5,"52":5,"53":5,"54":5,"55":1,"56":0,"57":5},"b":{"1":[2,0],"2":[0,2],"3":[1,0],"4":[0,1],"5":[1,0],"6":[0,1],"7":[0,0],"8":[1,4],"9":[0,0],"10":[5,0],"11":[5,0],"12":[1,4]},"f":{"1":2,"2":1,"3":1,"4":5,"5":0,"6":5},"fnMap":{"1":{"name":"formatStats","line":6,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":96}}},"2":{"name":"stats","line":34,"loc":{"start":{"line":34,"column":16},"end":{"line":34,"column":65}}},"3":{"name":"list","line":67,"loc":{"start":{"line":67,"column":15},"end":{"line":67,"column":58}}},"4":{"name":"folderIterator","line":71,"loc":{"start":{"line":71,"column":16},"end":{"line":71,"column":47}}},"5":{"name":"getSymlinkInfo","line":87,"loc":{"start":{"line":87,"column":25},"end":{"line":87,"column":60}}},"6":{"name":"filter","line":105,"loc":{"start":{"line":105,"column":17},"end":{"line":105,"column":57}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":25}},"3":{"start":{"line":6,"column":0},"end":{"line":32,"column":2}},"4":{"start":{"line":7,"column":2},"end":{"line":12,"column":4}},"5":{"start":{"line":14,"column":2},"end":{"line":29,"column":3}},"6":{"start":{"line":15,"column":4},"end":{"line":28,"column":5}},"7":{"start":{"line":16,"column":6},"end":{"line":16,"column":29}},"8":{"start":{"line":19,"column":6},"end":{"line":19,"column":29}},"9":{"start":{"line":20,"column":6},"end":{"line":27,"column":8}},"10":{"start":{"line":31,"column":2},"end":{"line":31,"column":15}},"11":{"start":{"line":34,"column":0},"end":{"line":65,"column":2}},"12":{"start":{"line":35,"column":2},"end":{"line":35,"column":23}},"13":{"start":{"line":36,"column":2},"end":{"line":36,"column":23}},"14":{"start":{"line":38,"column":2},"end":{"line":60,"column":3}},"15":{"start":{"line":39,"column":4},"end":{"line":59,"column":5}},"16":{"start":{"line":40,"column":6},"end":{"line":40,"column":41}},"17":{"start":{"line":42,"column":6},"end":{"line":46,"column":7}},"18":{"start":{"line":45,"column":8},"end":{"line":45,"column":41}},"19":{"start":{"line":48,"column":6},"end":{"line":48,"column":107}},"20":{"start":{"line":50,"column":6},"end":{"line":55,"column":7}},"21":{"start":{"line":51,"column":8},"end":{"line":51,"column":56}},"22":{"start":{"line":53,"column":8},"end":{"line":53,"column":43}},"23":{"start":{"line":54,"column":8},"end":{"line":54,"column":51}},"24":{"start":{"line":58,"column":6},"end":{"line":58,"column":20}},"25":{"start":{"line":62,"column":2},"end":{"line":62,"column":103}},"26":{"start":{"line":64,"column":2},"end":{"line":64,"column":19}},"27":{"start":{"line":67,"column":0},"end":{"line":85,"column":2}},"28":{"start":{"line":68,"column":2},"end":{"line":68,"column":41}},"29":{"start":{"line":69,"column":2},"end":{"line":69,"column":19}},"30":{"start":{"line":71,"column":2},"end":{"line":81,"column":5}},"31":{"start":{"line":72,"column":4},"end":{"line":72,"column":49}},"32":{"start":{"line":74,"column":4},"end":{"line":80,"column":5}},"33":{"start":{"line":75,"column":6},"end":{"line":75,"column":59}},"34":{"start":{"line":77,"column":6},"end":{"line":77,"column":34}},"35":{"start":{"line":79,"column":6},"end":{"line":79,"column":40}},"36":{"start":{"line":84,"column":2},"end":{"line":84,"column":20}},"37":{"start":{"line":87,"column":0},"end":{"line":103,"column":2}},"38":{"start":{"line":88,"column":2},"end":{"line":88,"column":46}},"39":{"start":{"line":89,"column":2},"end":{"line":91,"column":4}},"40":{"start":{"line":93,"column":2},"end":{"line":100,"column":3}},"41":{"start":{"line":94,"column":4},"end":{"line":94,"column":45}},"42":{"start":{"line":97,"column":4},"end":{"line":99,"column":5}},"43":{"start":{"line":98,"column":6},"end":{"line":98,"column":26}},"44":{"start":{"line":102,"column":2},"end":{"line":102,"column":14}},"45":{"start":{"line":105,"column":0},"end":{"line":133,"column":2}},"46":{"start":{"line":106,"column":2},"end":{"line":106,"column":20}},"47":{"start":{"line":108,"column":2},"end":{"line":130,"column":3}},"48":{"start":{"line":109,"column":4},"end":{"line":109,"column":31}},"49":{"start":{"line":111,"column":4},"end":{"line":125,"column":5}},"50":{"start":{"line":112,"column":6},"end":{"line":112,"column":41}},"51":{"start":{"line":114,"column":6},"end":{"line":117,"column":7}},"52":{"start":{"line":116,"column":8},"end":{"line":116,"column":67}},"53":{"start":{"line":119,"column":6},"end":{"line":119,"column":47}},"54":{"start":{"line":121,"column":6},"end":{"line":124,"column":7}},"55":{"start":{"line":123,"column":8},"end":{"line":123,"column":14}},"56":{"start":{"line":129,"column":4},"end":{"line":129,"column":17}},"57":{"start":{"line":132,"column":2},"end":{"line":132,"column":15}}},"branchMap":{"1":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":14,"column":2}},{"start":{"line":14,"column":2},"end":{"line":14,"column":2}}]},"2":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":15,"column":4}},{"start":{"line":15,"column":4},"end":{"line":15,"column":4}}]},"3":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":38,"column":2}},{"start":{"line":38,"column":2},"end":{"line":38,"column":2}}]},"4":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"5":{"line":42,"type":"binary-expr","locations":[{"start":{"line":42,"column":10},"end":{"line":42,"column":29}},{"start":{"line":42,"column":33},"end":{"line":42,"column":53}}]},"6":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":6},"end":{"line":50,"column":6}},{"start":{"line":50,"column":6},"end":{"line":50,"column":6}}]},"7":{"line":54,"type":"binary-expr","locations":[{"start":{"line":54,"column":32},"end":{"line":54,"column":42}},{"start":{"line":54,"column":46},"end":{"line":54,"column":50}}]},"8":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":74,"column":4}},{"start":{"line":74,"column":4},"end":{"line":74,"column":4}}]},"9":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":4},"end":{"line":97,"column":4}},{"start":{"line":97,"column":4},"end":{"line":97,"column":4}}]},"10":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":2},"end":{"line":108,"column":2}},{"start":{"line":108,"column":2},"end":{"line":108,"column":2}}]},"11":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":6},"end":{"line":114,"column":6}},{"start":{"line":114,"column":6},"end":{"line":114,"column":6}}]},"12":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":6},"end":{"line":121,"column":6}},{"start":{"line":121,"column":6},"end":{"line":121,"column":6}}]}},"l":{"3":1,"4":1,"6":1,"7":2,"14":2,"15":2,"16":0,"19":2,"20":2,"31":2,"34":1,"35":1,"36":1,"38":1,"39":1,"40":1,"42":1,"45":0,"48":1,"50":1,"51":0,"53":0,"54":0,"58":0,"62":1,"64":1,"67":1,"68":1,"69":1,"71":1,"72":5,"74":5,"75":1,"77":1,"79":1,"84":1,"87":1,"88":0,"89":0,"93":0,"94":0,"97":0,"98":0,"102":0,"105":1,"106":5,"108":5,"109":5,"111":5,"112":5,"114":5,"116":5,"119":5,"121":5,"123":1,"129":0,"132":5}}}
'use strict';
var path = require('path');
var devmode = require('devmode');
require('chai').should();
var Crawler = require('../lib/fs-crawler');
var options = {
root: path.normalize(__dirname + path.sep + '..' + path.sep + 'lib'),
maxDepth: 0
var Crawler = require('../lib/fs-crawler');
var testPath = path.normalize(__dirname + path.sep + 'fs');
var options = {
reverse: true,
noStats: false,
filters: ['txt'],
maxDepth: 4
};
var crawler = new Crawler(options);
var crawler = new Crawler();
var results = crawler.crawlTreeSync(testPath, options);
crawler.setEncoding('utf8');
crawler.on('data', function (data) {
console.log('=>'+data+'<=');
data = JSON.parse(data);
console.log(data.folderId, '=>', data.path);
});
crawler.on('end', function (data) {
console.log(data, '\n');
console.log(data);
});

@@ -25,0 +31,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc