Clean up the oopsie. Rebuild the blank exercises.

This commit is contained in:
Michael Frank
2021-05-09 00:39:21 +12:00
parent b984cb4c6f
commit d28d80c46f
1565 changed files with 27186 additions and 199003 deletions
+16 -9
View File
@@ -2,7 +2,9 @@
> Check if a path exists
Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.
While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
Never use this before handling a file though:
@@ -12,7 +14,7 @@ Never use this before handling a file though:
## Install
```
$ npm install --save path-exists
$ npm install path-exists
```
@@ -20,12 +22,12 @@ $ npm install --save path-exists
```js
// foo.js
var pathExists = require('path-exists');
const pathExists = require('path-exists');
pathExists('foo.js').then(function (exists) {
console.log(exists);
(async () => {
console.log(await pathExists('foo.js'));
//=> true
});
})();
```
@@ -33,13 +35,18 @@ pathExists('foo.js').then(function (exists) {
### pathExists(path)
Returns a promise that resolves to a boolean of whether the path exists.
Returns a `Promise<boolean>` of whether the path exists.
### pathExists.sync(path)
Returns a boolean of whether the path exists.
Returns a `boolean` of whether the path exists.
## Related
- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)