source: trip-planner-front/node_modules/path-dirname/readme.md@ e29cc2e

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

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1# path-dirname [![Build Status](https://travis-ci.org/es128/path-dirname.svg?branch=master)](https://travis-ci.org/es128/path-dirname)
2
3> Node.js [`path.dirname()`](https://nodejs.org/api/path.html#path_path_dirname_path) [ponyfill](https://ponyfill.com)
4
5This was needed in order to expose `path.posix.dirname()` on Node.js v0.10
6
7## Install
8
9```
10$ npm install --save path-dirname
11```
12
13
14## Usage
15
16```js
17const pathDirname = require('path-dirname');
18
19pathDirname('/home/foo');
20//=> '/home'
21pathDirname('C:\\Users\\foo');
22//=> 'C:\\Users'
23pathDirname('foo');
24//=> '.'
25pathDirname('foo/bar');
26//=> 'foo'
27
28//Using posix version for consistent output when dealing with glob escape chars
29pathDirname.win32('C:\\Users\\foo/\\*bar');
30//=> 'C:\\Users\\foo/'
31pathDirname.posix('C:\\Users\\foo/\\*bar');
32//=> 'C:\\Users\\foo'
33```
34
35
36## API
37
38See the [`path.dirname()` docs](https://nodejs.org/api/path.html#path_path_dirname_path).
39
40### pathDirname(path)
41
42### pathDirname.posix(path)
43
44POSIX specific version.
45
46### pathDirname.win32(path)
47
48Windows specific version.
49
50
51## License
52
53MIT
Note: See TracBrowser for help on using the repository browser.