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 authored and ljharb committed Apr 5, 2018
1 parent 7a2edf8 commit a578a0f
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 @@ -31,7 +31,7 @@ module.exports = function resolve(x, options, callback) {
var isFile = opts.isFile || defaultIsFile;
var readFile = opts.readFile || fs.readFile;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || ['.js', '.json', '.node'];
var basedir = 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 @@ -22,7 +22,7 @@ module.exports = function (x, options) {
var isFile = opts.isFile || defaultIsFile;
var readFileSync = opts.readFileSync || fs.readFileSync;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || ['.js', '.json', '.node'];
var basedir = 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 @@ -82,7 +82,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: [ '.js', '.json', '.node' ],
readFile: fs.readFile,
isFile: function isFile(file, cb) {
fs.stat(file, function (err, stat) {
Expand Down Expand Up @@ -136,7 +136,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: [ '.js', '.json', '.node' ],
readFileSync: fs.readFileSync,
isFile: function isFile(file) {
try {
Expand Down

0 comments on commit a578a0f

Please sign in to comment.