existsofpath
Version:
Get the existing part of a given path, asynchronously
28 lines (19 loc) • 1.04 kB
Markdown
# existsofpath
[](https://travis-ci.org/ecman/existsofpath) [](https://codecov.io/gh/ecman/existsofpath) [](https://codeclimate.com/github/ecman/existsofpath) [](https://ci.appveyor.com/project/ecman/existsofpath/branch/master)
Get the existing part of a given path, asynchronously.
# Usage
```js
'use strict';
const existsOfPath = require('existsofpath');
// If an empty "test" folder exists
// in the current working directory
let pathToCheck = 'test/some/where/not/there';
existsOfPath(pathToCheck)
.then((existingPath) =>
console.log(
`Path "${existingPath}" exists of given path "${pathToCheck}"`));
```
Output
```text
Path "test" exists of given path "test/some/where/not/there"
```