source: node_modules/file-uri-to-path/README.md@ 81bc7da

finki-main main
Last change on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1file-uri-to-path
2================
3### Convert a `file:` URI to a file path
4[![Build Status](https://travis-ci.org/TooTallNate/file-uri-to-path.svg?branch=master)](https://travis-ci.org/TooTallNate/file-uri-to-path)
5
6Accepts a `file:` URI and returns a regular file path suitable for use with the
7`fs` module functions.
8
9
10Installation
11------------
12
13Install with `npm`:
14
15``` bash
16$ npm install file-uri-to-path
17```
18
19
20Example
21-------
22
23``` js
24var uri2path = require('file-uri-to-path');
25
26uri2path('file://localhost/c|/WINDOWS/clock.avi');
27// "c:\\WINDOWS\\clock.avi"
28
29uri2path('file:///c|/WINDOWS/clock.avi');
30// "c:\\WINDOWS\\clock.avi"
31
32uri2path('file://localhost/c:/WINDOWS/clock.avi');
33// "c:\\WINDOWS\\clock.avi"
34
35uri2path('file://hostname/path/to/the%20file.txt');
36// "\\\\hostname\\path\\to\\the file.txt"
37
38uri2path('file:///c:/path/to/the%20file.txt');
39// "c:\\path\\to\\the file.txt"
40```
41
42
43API
44---
45
46### fileUriToPath(String uri) → String
47
48
49
50License
51-------
52
53(The MIT License)
54
55Copyright (c) 2014 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
56
57Permission is hereby granted, free of charge, to any person obtaining
58a copy of this software and associated documentation files (the
59'Software'), to deal in the Software without restriction, including
60without limitation the rights to use, copy, modify, merge, publish,
61distribute, sublicense, and/or sell copies of the Software, and to
62permit persons to whom the Software is furnished to do so, subject to
63the following conditions:
64
65The above copyright notice and this permission notice shall be
66included in all copies or substantial portions of the Software.
67
68THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
69EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
70MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
71IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
72CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
73TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
74SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: See TracBrowser for help on using the repository browser.