source: trip-planner-front/node_modules/path-type/readme.md@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type)
2
3> Check if a path is a file, directory, or symlink
4
5
6## Install
7
8```
9$ npm install path-type
10```
11
12
13## Usage
14
15```js
16const {isFile} = require('path-type');
17
18(async () => {
19 console.log(await isFile('package.json'));
20 //=> true
21})();
22```
23
24
25## API
26
27### isFile(path)
28
29Check whether the passed `path` is a file.
30
31Returns a `Promise<boolean>`.
32
33#### path
34
35Type: `string`
36
37The path to check.
38
39### isDirectory(path)
40
41Check whether the passed `path` is a directory.
42
43Returns a `Promise<boolean>`.
44
45### isSymlink(path)
46
47Check whether the passed `path` is a symlink.
48
49Returns a `Promise<boolean>`.
50
51### isFileSync(path)
52
53Synchronously check whether the passed `path` is a file.
54
55Returns a `boolean`.
56
57### isDirectorySync(path)
58
59Synchronously check whether the passed `path` is a directory.
60
61Returns a `boolean`.
62
63### isSymlinkSync(path)
64
65Synchronously check whether the passed `path` is a symlink.
66
67Returns a `boolean`.
68
69
70## License
71
72MIT © [Sindre Sorhus](https://sindresorhus.com)
Note: See TracBrowser for help on using the repository browser.