Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ var path = require('path');
var resolve = require('resolve');

module.exports = function (file, opts) {
if (/\.json$/.test(file)) return through();
var ignore = opts.ignore || opts.i || /\.json$/;
if (typeof ignore === 'string') { ignore = new RegExp(ignore); }

if (ignore.test(file)) return through();

function resolver (p) {
return resolve.sync(p, { basedir: path.dirname(file) });
Expand Down
4 changes: 4 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ Optionally, you can set which `opts.vars` will be used in the
[static argument evaluation](https://npmjs.org/package/static-eval)
in addition to `__dirname` and `__filename`.

`opts.ignore` can be used to skip certain files. It expects a `RegExp` but
if a string is given it will convert. If omitted the default of `/\.json$/`
is used.

# events

## tr.on('file', function (file) {})
Expand Down