]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / README.md
1 path-array
2 ==========
3 ### Treat your `$PATH` like a JavaScript Array
4 [![Build Status](https://travis-ci.org/TooTallNate/path-array.svg?branch=master)](https://travis-ci.org/TooTallNate/path-array)
5
6 This module provides a JavaScript `Array` implementation that is backed by your
7 `$PATH` env variable. That is, you can use regular Array functions like `shift()`,
8 `pop()`, `push()`, `unshift()`, etc. to mutate your `$PATH`.
9
10 Also works for preparing an `env` object for passing to
11 [`child_process.spawn()`][cp.spawn].
12
13
14 Installation
15 ------------
16
17 Install with `npm`:
18
19 ``` bash
20 $ npm install path-array
21 ```
22
23
24 Example
25 -------
26
27 Interacting with your own `$PATH` env variable:
28
29 ``` js
30 var PathArray = require('path-array');
31
32 // no args uses `process.env` by default
33 var p = new PathArray();
34
35 console.log(p);
36 // [ './node_modules/.bin',
37 //   '/opt/local/bin',
38 //   '/opt/local/sbin',
39 //   '/usr/local/bin',
40 //   '/usr/local/sbin',
41 //   '/usr/bin',
42 //   '/bin',
43 //   '/usr/sbin',
44 //   '/sbin',
45 //   '/usr/local/bin',
46 //   '/opt/X11/bin' ]
47
48 // push another path entry. this function mutates the `process.env.PATH`
49 p.unshift('/foo');
50
51 console.log(process.env.PATH);
52 // '/foo:./node_modules/.bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin'
53 ```
54
55
56 API
57 ---
58
59 ### new PathArray([env]) → PathArray
60
61 Creates and returns a new `PathArray` instance with the given `env` object. If no
62 `env` is specified, then [`process.env`][process.env] is used by default.
63
64
65 License
66 -------
67
68 (The MIT License)
69
70 Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
71
72 Permission is hereby granted, free of charge, to any person obtaining
73 a copy of this software and associated documentation files (the
74 'Software'), to deal in the Software without restriction, including
75 without limitation the rights to use, copy, modify, merge, publish,
76 distribute, sublicense, and/or sell copies of the Software, and to
77 permit persons to whom the Software is furnished to do so, subject to
78 the following conditions:
79
80 The above copyright notice and this permission notice shall be
81 included in all copies or substantial portions of the Software.
82
83 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
84 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
85 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
86 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
87 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
88 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
89 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
90
91 [process.env]: http://nodejs.org/docs/latest/api/process.html#process_process_env
92 [cp.spawn]: http://nodejs.org/docs/latest/api/child_process.html#child_process_child_process_spawn_command_args_options