Skip to content

Commit

Permalink
Update default extensions to match node
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Jan 4, 2018
1 parent 2674fad commit 59c4cd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function resolve(x, options, callback) {
};
var readFile = opts.readFile || fs.readFile;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || ['.js', '.json', '.node'];
var y = opts.basedir || path.dirname(caller());

opts.paths = opts.paths || [];
Expand Down
2 changes: 1 addition & 1 deletion lib/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function (x, options) {
};
var readFileSync = opts.readFileSync || fs.readFileSync;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || ['.js', '.json', '.node'];
var y = opts.basedir || path.dirname(caller());

opts.paths = opts.paths || [];
Expand Down
4 changes: 2 additions & 2 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: [ '.js', '.json', '.node' ],
readFile: fs.readFile,
isFile: function (file, cb) {
fs.stat(file, function (err, stat) {
Expand Down Expand Up @@ -132,7 +132,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: [ '.js', '.json', '.node' ],
readFileSync: fs.readFileSync,
isFile: function (file) {
try { return fs.statSync(file).isFile() }
Expand Down

0 comments on commit 59c4cd8

Please sign in to comment.