Skip to content

Commit

Permalink
new packageFilter option
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 21, 2011
1 parent 2ad8287 commit c92c883
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ exports.sync = function (x, opts) {
var body = fs.readFileSync(pkgfile, 'utf8');
try {
var pkg = JSON.parse(body);
if (opts.packageFilter) {
pkg = opts.packageFilter(pkg);
}

if (pkg.main) {
var m = loadAsFileSync(path.resolve(x, pkg.main));
if (m) return m;
Expand Down
Empty file added test/resolver/baz/doom.js
Empty file.

0 comments on commit c92c883

Please sign in to comment.