Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the undeprecated fs.accessSync #7

Merged
merged 1 commit into from
Oct 17, 2016
Merged

Use the undeprecated fs.accessSync #7

merged 1 commit into from
Oct 17, 2016

Conversation

SimenB
Copy link
Contributor

@SimenB SimenB commented Oct 15, 2016

See nodejs/node#8364

Might even deprecate the whole module? Unsure how useful an asynchronous version is

return false;
}
};
module.exports.sync = fs.existsSync;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not interested in changing the behavior at this point. It would also make it inconsistent with the async version. Documentation change is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the exact same behavior though, except for dropping the overhead of try-catching? Unless I'm missing something?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the exact same behavior though

They call different native methods internally.

except for dropping the overhead of try-catching?

Still try/catch: https://github.com/nodejs/node/blob/9bb250ba340a805b6189b9ad39716722e6c41618/lib/fs.js#L243-L251

@SimenB
Copy link
Contributor Author

SimenB commented Oct 17, 2016

@sindresorhus updated

@sindresorhus sindresorhus merged commit 67c0725 into sindresorhus:master Oct 17, 2016
@SimenB SimenB deleted the fs-access-sync branch October 17, 2016 17:13
sindresorhus pushed a commit that referenced this pull request Oct 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants