@mrgrain/cdk-esbuild 4.0.0-alpha.5 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +533 -330
- package/.projenrc.ts +10 -4
- package/API.md +349 -166
- package/CHANGELOG.md +12 -0
- package/README.md +16 -6
- package/lib/asset.d.ts +8 -4
- package/lib/asset.js +18 -11
- package/lib/bundler.d.ts +8 -0
- package/lib/bundler.js +7 -2
- package/lib/code.d.ts +39 -22
- package/lib/code.js +48 -16
- package/lib/esbuild-polyfill.js +29 -31
- package/lib/esbuild-types.d.ts +5 -1
- package/lib/esbuild-types.js +1 -1
- package/lib/esbuild-wrapper.js +5 -11
- package/lib/index.d.ts +4 -4
- package/lib/index.js +3 -1
- package/lib/inline-code.js +4 -4
- package/lib/source.js +2 -2
- package/package.json +7 -13
- package/node_modules/isexe/.npmignore +0 -2
- package/node_modules/isexe/LICENSE +0 -15
- package/node_modules/isexe/README.md +0 -51
- package/node_modules/isexe/index.js +0 -57
- package/node_modules/isexe/mode.js +0 -41
- package/node_modules/isexe/package.json +0 -35
- package/node_modules/isexe/test/basic.js +0 -221
- package/node_modules/isexe/windows.js +0 -42
- package/node_modules/which/CHANGELOG.md +0 -166
- package/node_modules/which/LICENSE +0 -15
- package/node_modules/which/README.md +0 -54
- package/node_modules/which/bin/node-which +0 -52
- package/node_modules/which/package.json +0 -47
- package/node_modules/which/which.js +0 -125
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# isexe
|
|
2
|
-
|
|
3
|
-
Minimal module to check if a file is executable, and a normal file.
|
|
4
|
-
|
|
5
|
-
Uses `fs.stat` and tests against the `PATHEXT` environment variable on
|
|
6
|
-
Windows.
|
|
7
|
-
|
|
8
|
-
## USAGE
|
|
9
|
-
|
|
10
|
-
```javascript
|
|
11
|
-
var isexe = require('isexe')
|
|
12
|
-
isexe('some-file-name', function (err, isExe) {
|
|
13
|
-
if (err) {
|
|
14
|
-
console.error('probably file does not exist or something', err)
|
|
15
|
-
} else if (isExe) {
|
|
16
|
-
console.error('this thing can be run')
|
|
17
|
-
} else {
|
|
18
|
-
console.error('cannot be run')
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
// same thing but synchronous, throws errors
|
|
23
|
-
var isExe = isexe.sync('some-file-name')
|
|
24
|
-
|
|
25
|
-
// treat errors as just "not executable"
|
|
26
|
-
isexe('maybe-missing-file', { ignoreErrors: true }, callback)
|
|
27
|
-
var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true })
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## API
|
|
31
|
-
|
|
32
|
-
### `isexe(path, [options], [callback])`
|
|
33
|
-
|
|
34
|
-
Check if the path is executable. If no callback provided, and a
|
|
35
|
-
global `Promise` object is available, then a Promise will be returned.
|
|
36
|
-
|
|
37
|
-
Will raise whatever errors may be raised by `fs.stat`, unless
|
|
38
|
-
`options.ignoreErrors` is set to true.
|
|
39
|
-
|
|
40
|
-
### `isexe.sync(path, [options])`
|
|
41
|
-
|
|
42
|
-
Same as `isexe` but returns the value and throws any errors raised.
|
|
43
|
-
|
|
44
|
-
### Options
|
|
45
|
-
|
|
46
|
-
* `ignoreErrors` Treat all errors as "no, this is not executable", but
|
|
47
|
-
don't raise them.
|
|
48
|
-
* `uid` Number to use as the user id
|
|
49
|
-
* `gid` Number to use as the group id
|
|
50
|
-
* `pathExt` List of path extensions to use instead of `PATHEXT`
|
|
51
|
-
environment variable on Windows.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var fs = require('fs')
|
|
2
|
-
var core
|
|
3
|
-
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
|
|
4
|
-
core = require('./windows.js')
|
|
5
|
-
} else {
|
|
6
|
-
core = require('./mode.js')
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
module.exports = isexe
|
|
10
|
-
isexe.sync = sync
|
|
11
|
-
|
|
12
|
-
function isexe (path, options, cb) {
|
|
13
|
-
if (typeof options === 'function') {
|
|
14
|
-
cb = options
|
|
15
|
-
options = {}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (!cb) {
|
|
19
|
-
if (typeof Promise !== 'function') {
|
|
20
|
-
throw new TypeError('callback not provided')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return new Promise(function (resolve, reject) {
|
|
24
|
-
isexe(path, options || {}, function (er, is) {
|
|
25
|
-
if (er) {
|
|
26
|
-
reject(er)
|
|
27
|
-
} else {
|
|
28
|
-
resolve(is)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
core(path, options || {}, function (er, is) {
|
|
35
|
-
// ignore EACCES because that just means we aren't allowed to run it
|
|
36
|
-
if (er) {
|
|
37
|
-
if (er.code === 'EACCES' || options && options.ignoreErrors) {
|
|
38
|
-
er = null
|
|
39
|
-
is = false
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
cb(er, is)
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function sync (path, options) {
|
|
47
|
-
// my kingdom for a filtered catch
|
|
48
|
-
try {
|
|
49
|
-
return core.sync(path, options || {})
|
|
50
|
-
} catch (er) {
|
|
51
|
-
if (options && options.ignoreErrors || er.code === 'EACCES') {
|
|
52
|
-
return false
|
|
53
|
-
} else {
|
|
54
|
-
throw er
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
module.exports = isexe
|
|
2
|
-
isexe.sync = sync
|
|
3
|
-
|
|
4
|
-
var fs = require('fs')
|
|
5
|
-
|
|
6
|
-
function isexe (path, options, cb) {
|
|
7
|
-
fs.stat(path, function (er, stat) {
|
|
8
|
-
cb(er, er ? false : checkStat(stat, options))
|
|
9
|
-
})
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function sync (path, options) {
|
|
13
|
-
return checkStat(fs.statSync(path), options)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function checkStat (stat, options) {
|
|
17
|
-
return stat.isFile() && checkMode(stat, options)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function checkMode (stat, options) {
|
|
21
|
-
var mod = stat.mode
|
|
22
|
-
var uid = stat.uid
|
|
23
|
-
var gid = stat.gid
|
|
24
|
-
|
|
25
|
-
var myUid = options.uid !== undefined ?
|
|
26
|
-
options.uid : process.getuid && process.getuid()
|
|
27
|
-
var myGid = options.gid !== undefined ?
|
|
28
|
-
options.gid : process.getgid && process.getgid()
|
|
29
|
-
|
|
30
|
-
var u = parseInt('100', 8)
|
|
31
|
-
var g = parseInt('010', 8)
|
|
32
|
-
var o = parseInt('001', 8)
|
|
33
|
-
var ug = u | g
|
|
34
|
-
|
|
35
|
-
var ret = (mod & o) ||
|
|
36
|
-
(mod & g) && gid === myGid ||
|
|
37
|
-
(mod & u) && uid === myUid ||
|
|
38
|
-
(mod & ug) && myUid === 0
|
|
39
|
-
|
|
40
|
-
return ret
|
|
41
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "isexe",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "Minimal module to check if a file is executable.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"directories": {
|
|
7
|
-
"test": "test"
|
|
8
|
-
},
|
|
9
|
-
"devDependencies": {
|
|
10
|
-
"mkdirp": "^0.5.1",
|
|
11
|
-
"rimraf": "^2.5.0",
|
|
12
|
-
"tap": "^10.3.0"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "tap test/*.js --100",
|
|
16
|
-
"preversion": "npm test",
|
|
17
|
-
"postversion": "npm publish",
|
|
18
|
-
"postpublish": "git push origin --all; git push origin --tags"
|
|
19
|
-
},
|
|
20
|
-
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/isaacs/isexe.git"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [],
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/isaacs/isexe/issues"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/isaacs/isexe#readme"
|
|
31
|
-
|
|
32
|
-
,"_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz"
|
|
33
|
-
,"_integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
|
|
34
|
-
,"_from": "isexe@2.0.0"
|
|
35
|
-
}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
var t = require('tap')
|
|
2
|
-
var fs = require('fs')
|
|
3
|
-
var path = require('path')
|
|
4
|
-
var fixture = path.resolve(__dirname, 'fixtures')
|
|
5
|
-
var meow = fixture + '/meow.cat'
|
|
6
|
-
var mine = fixture + '/mine.cat'
|
|
7
|
-
var ours = fixture + '/ours.cat'
|
|
8
|
-
var fail = fixture + '/fail.false'
|
|
9
|
-
var noent = fixture + '/enoent.exe'
|
|
10
|
-
var mkdirp = require('mkdirp')
|
|
11
|
-
var rimraf = require('rimraf')
|
|
12
|
-
|
|
13
|
-
var isWindows = process.platform === 'win32'
|
|
14
|
-
var hasAccess = typeof fs.access === 'function'
|
|
15
|
-
var winSkip = isWindows && 'windows'
|
|
16
|
-
var accessSkip = !hasAccess && 'no fs.access function'
|
|
17
|
-
var hasPromise = typeof Promise === 'function'
|
|
18
|
-
var promiseSkip = !hasPromise && 'no global Promise'
|
|
19
|
-
|
|
20
|
-
function reset () {
|
|
21
|
-
delete require.cache[require.resolve('../')]
|
|
22
|
-
return require('../')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
t.test('setup fixtures', function (t) {
|
|
26
|
-
rimraf.sync(fixture)
|
|
27
|
-
mkdirp.sync(fixture)
|
|
28
|
-
fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n')
|
|
29
|
-
fs.chmodSync(meow, parseInt('0755', 8))
|
|
30
|
-
fs.writeFileSync(fail, '#!/usr/bin/env false\n')
|
|
31
|
-
fs.chmodSync(fail, parseInt('0644', 8))
|
|
32
|
-
fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n')
|
|
33
|
-
fs.chmodSync(mine, parseInt('0744', 8))
|
|
34
|
-
fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n')
|
|
35
|
-
fs.chmodSync(ours, parseInt('0754', 8))
|
|
36
|
-
t.end()
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
t.test('promise', { skip: promiseSkip }, function (t) {
|
|
40
|
-
var isexe = reset()
|
|
41
|
-
t.test('meow async', function (t) {
|
|
42
|
-
isexe(meow).then(function (is) {
|
|
43
|
-
t.ok(is)
|
|
44
|
-
t.end()
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
t.test('fail async', function (t) {
|
|
48
|
-
isexe(fail).then(function (is) {
|
|
49
|
-
t.notOk(is)
|
|
50
|
-
t.end()
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
t.test('noent async', function (t) {
|
|
54
|
-
isexe(noent).catch(function (er) {
|
|
55
|
-
t.ok(er)
|
|
56
|
-
t.end()
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
t.test('noent ignore async', function (t) {
|
|
60
|
-
isexe(noent, { ignoreErrors: true }).then(function (is) {
|
|
61
|
-
t.notOk(is)
|
|
62
|
-
t.end()
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
t.end()
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
t.test('no promise', function (t) {
|
|
69
|
-
global.Promise = null
|
|
70
|
-
var isexe = reset()
|
|
71
|
-
t.throws('try to meow a promise', function () {
|
|
72
|
-
isexe(meow)
|
|
73
|
-
})
|
|
74
|
-
t.end()
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
t.test('access', { skip: accessSkip || winSkip }, function (t) {
|
|
78
|
-
runTest(t)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
t.test('mode', { skip: winSkip }, function (t) {
|
|
82
|
-
delete fs.access
|
|
83
|
-
delete fs.accessSync
|
|
84
|
-
var isexe = reset()
|
|
85
|
-
t.ok(isexe.sync(ours, { uid: 0, gid: 0 }))
|
|
86
|
-
t.ok(isexe.sync(mine, { uid: 0, gid: 0 }))
|
|
87
|
-
runTest(t)
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
t.test('windows', function (t) {
|
|
91
|
-
global.TESTING_WINDOWS = true
|
|
92
|
-
var pathExt = '.EXE;.CAT;.CMD;.COM'
|
|
93
|
-
t.test('pathExt option', function (t) {
|
|
94
|
-
runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' })
|
|
95
|
-
})
|
|
96
|
-
t.test('pathExt env', function (t) {
|
|
97
|
-
process.env.PATHEXT = pathExt
|
|
98
|
-
runTest(t)
|
|
99
|
-
})
|
|
100
|
-
t.test('no pathExt', function (t) {
|
|
101
|
-
// with a pathExt of '', any filename is fine.
|
|
102
|
-
// so the "fail" one would still pass.
|
|
103
|
-
runTest(t, { pathExt: '', skipFail: true })
|
|
104
|
-
})
|
|
105
|
-
t.test('pathext with empty entry', function (t) {
|
|
106
|
-
// with a pathExt of '', any filename is fine.
|
|
107
|
-
// so the "fail" one would still pass.
|
|
108
|
-
runTest(t, { pathExt: ';' + pathExt, skipFail: true })
|
|
109
|
-
})
|
|
110
|
-
t.end()
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
t.test('cleanup', function (t) {
|
|
114
|
-
rimraf.sync(fixture)
|
|
115
|
-
t.end()
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
function runTest (t, options) {
|
|
119
|
-
var isexe = reset()
|
|
120
|
-
|
|
121
|
-
var optionsIgnore = Object.create(options || {})
|
|
122
|
-
optionsIgnore.ignoreErrors = true
|
|
123
|
-
|
|
124
|
-
if (!options || !options.skipFail) {
|
|
125
|
-
t.notOk(isexe.sync(fail, options))
|
|
126
|
-
}
|
|
127
|
-
t.notOk(isexe.sync(noent, optionsIgnore))
|
|
128
|
-
if (!options) {
|
|
129
|
-
t.ok(isexe.sync(meow))
|
|
130
|
-
} else {
|
|
131
|
-
t.ok(isexe.sync(meow, options))
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
t.ok(isexe.sync(mine, options))
|
|
135
|
-
t.ok(isexe.sync(ours, options))
|
|
136
|
-
t.throws(function () {
|
|
137
|
-
isexe.sync(noent, options)
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
t.test('meow async', function (t) {
|
|
141
|
-
if (!options) {
|
|
142
|
-
isexe(meow, function (er, is) {
|
|
143
|
-
if (er) {
|
|
144
|
-
throw er
|
|
145
|
-
}
|
|
146
|
-
t.ok(is)
|
|
147
|
-
t.end()
|
|
148
|
-
})
|
|
149
|
-
} else {
|
|
150
|
-
isexe(meow, options, function (er, is) {
|
|
151
|
-
if (er) {
|
|
152
|
-
throw er
|
|
153
|
-
}
|
|
154
|
-
t.ok(is)
|
|
155
|
-
t.end()
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
t.test('mine async', function (t) {
|
|
161
|
-
isexe(mine, options, function (er, is) {
|
|
162
|
-
if (er) {
|
|
163
|
-
throw er
|
|
164
|
-
}
|
|
165
|
-
t.ok(is)
|
|
166
|
-
t.end()
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
t.test('ours async', function (t) {
|
|
171
|
-
isexe(ours, options, function (er, is) {
|
|
172
|
-
if (er) {
|
|
173
|
-
throw er
|
|
174
|
-
}
|
|
175
|
-
t.ok(is)
|
|
176
|
-
t.end()
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
if (!options || !options.skipFail) {
|
|
181
|
-
t.test('fail async', function (t) {
|
|
182
|
-
isexe(fail, options, function (er, is) {
|
|
183
|
-
if (er) {
|
|
184
|
-
throw er
|
|
185
|
-
}
|
|
186
|
-
t.notOk(is)
|
|
187
|
-
t.end()
|
|
188
|
-
})
|
|
189
|
-
})
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
t.test('noent async', function (t) {
|
|
193
|
-
isexe(noent, options, function (er, is) {
|
|
194
|
-
t.ok(er)
|
|
195
|
-
t.notOk(is)
|
|
196
|
-
t.end()
|
|
197
|
-
})
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
t.test('noent ignore async', function (t) {
|
|
201
|
-
isexe(noent, optionsIgnore, function (er, is) {
|
|
202
|
-
if (er) {
|
|
203
|
-
throw er
|
|
204
|
-
}
|
|
205
|
-
t.notOk(is)
|
|
206
|
-
t.end()
|
|
207
|
-
})
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
t.test('directory is not executable', function (t) {
|
|
211
|
-
isexe(__dirname, options, function (er, is) {
|
|
212
|
-
if (er) {
|
|
213
|
-
throw er
|
|
214
|
-
}
|
|
215
|
-
t.notOk(is)
|
|
216
|
-
t.end()
|
|
217
|
-
})
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
t.end()
|
|
221
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module.exports = isexe
|
|
2
|
-
isexe.sync = sync
|
|
3
|
-
|
|
4
|
-
var fs = require('fs')
|
|
5
|
-
|
|
6
|
-
function checkPathExt (path, options) {
|
|
7
|
-
var pathext = options.pathExt !== undefined ?
|
|
8
|
-
options.pathExt : process.env.PATHEXT
|
|
9
|
-
|
|
10
|
-
if (!pathext) {
|
|
11
|
-
return true
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
pathext = pathext.split(';')
|
|
15
|
-
if (pathext.indexOf('') !== -1) {
|
|
16
|
-
return true
|
|
17
|
-
}
|
|
18
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
19
|
-
var p = pathext[i].toLowerCase()
|
|
20
|
-
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
21
|
-
return true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return false
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function checkStat (stat, path, options) {
|
|
28
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
29
|
-
return false
|
|
30
|
-
}
|
|
31
|
-
return checkPathExt(path, options)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function isexe (path, options, cb) {
|
|
35
|
-
fs.stat(path, function (er, stat) {
|
|
36
|
-
cb(er, er ? false : checkStat(stat, path, options))
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function sync (path, options) {
|
|
41
|
-
return checkStat(fs.statSync(path), path, options)
|
|
42
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Changes
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
## 2.0.2
|
|
5
|
-
|
|
6
|
-
* Rename bin to `node-which`
|
|
7
|
-
|
|
8
|
-
## 2.0.1
|
|
9
|
-
|
|
10
|
-
* generate changelog and publish on version bump
|
|
11
|
-
* enforce 100% test coverage
|
|
12
|
-
* Promise interface
|
|
13
|
-
|
|
14
|
-
## 2.0.0
|
|
15
|
-
|
|
16
|
-
* Parallel tests, modern JavaScript, and drop support for node < 8
|
|
17
|
-
|
|
18
|
-
## 1.3.1
|
|
19
|
-
|
|
20
|
-
* update deps
|
|
21
|
-
* update travis
|
|
22
|
-
|
|
23
|
-
## v1.3.0
|
|
24
|
-
|
|
25
|
-
* Add nothrow option to which.sync
|
|
26
|
-
* update tap
|
|
27
|
-
|
|
28
|
-
## v1.2.14
|
|
29
|
-
|
|
30
|
-
* appveyor: drop node 5 and 0.x
|
|
31
|
-
* travis-ci: add node 6, drop 0.x
|
|
32
|
-
|
|
33
|
-
## v1.2.13
|
|
34
|
-
|
|
35
|
-
* test: Pass missing option to pass on windows
|
|
36
|
-
* update tap
|
|
37
|
-
* update isexe to 2.0.0
|
|
38
|
-
* neveragain.tech pledge request
|
|
39
|
-
|
|
40
|
-
## v1.2.12
|
|
41
|
-
|
|
42
|
-
* Removed unused require
|
|
43
|
-
|
|
44
|
-
## v1.2.11
|
|
45
|
-
|
|
46
|
-
* Prevent changelog script from being included in package
|
|
47
|
-
|
|
48
|
-
## v1.2.10
|
|
49
|
-
|
|
50
|
-
* Use env.PATH only, not env.Path
|
|
51
|
-
|
|
52
|
-
## v1.2.9
|
|
53
|
-
|
|
54
|
-
* fix for paths starting with ../
|
|
55
|
-
* Remove unused `is-absolute` module
|
|
56
|
-
|
|
57
|
-
## v1.2.8
|
|
58
|
-
|
|
59
|
-
* bullet items in changelog that contain (but don't start with) #
|
|
60
|
-
|
|
61
|
-
## v1.2.7
|
|
62
|
-
|
|
63
|
-
* strip 'update changelog' changelog entries out of changelog
|
|
64
|
-
|
|
65
|
-
## v1.2.6
|
|
66
|
-
|
|
67
|
-
* make the changelog bulleted
|
|
68
|
-
|
|
69
|
-
## v1.2.5
|
|
70
|
-
|
|
71
|
-
* make a changelog, and keep it up to date
|
|
72
|
-
* don't include tests in package
|
|
73
|
-
* Properly handle relative-path executables
|
|
74
|
-
* appveyor
|
|
75
|
-
* Attach error code to Not Found error
|
|
76
|
-
* Make tests pass on Windows
|
|
77
|
-
|
|
78
|
-
## v1.2.4
|
|
79
|
-
|
|
80
|
-
* Fix typo
|
|
81
|
-
|
|
82
|
-
## v1.2.3
|
|
83
|
-
|
|
84
|
-
* update isexe, fix regression in pathExt handling
|
|
85
|
-
|
|
86
|
-
## v1.2.2
|
|
87
|
-
|
|
88
|
-
* update deps, use isexe module, test windows
|
|
89
|
-
|
|
90
|
-
## v1.2.1
|
|
91
|
-
|
|
92
|
-
* Sometimes windows PATH entries are quoted
|
|
93
|
-
* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
|
|
94
|
-
* doc cli
|
|
95
|
-
|
|
96
|
-
## v1.2.0
|
|
97
|
-
|
|
98
|
-
* Add support for opt.all and -as cli flags
|
|
99
|
-
* test the bin
|
|
100
|
-
* update travis
|
|
101
|
-
* Allow checking for multiple programs in bin/which
|
|
102
|
-
* tap 2
|
|
103
|
-
|
|
104
|
-
## v1.1.2
|
|
105
|
-
|
|
106
|
-
* travis
|
|
107
|
-
* Refactored and fixed undefined error on Windows
|
|
108
|
-
* Support strict mode
|
|
109
|
-
|
|
110
|
-
## v1.1.1
|
|
111
|
-
|
|
112
|
-
* test +g exes against secondary groups, if available
|
|
113
|
-
* Use windows exe semantics on cygwin & msys
|
|
114
|
-
* cwd should be first in path on win32, not last
|
|
115
|
-
* Handle lower-case 'env.Path' on Windows
|
|
116
|
-
* Update docs
|
|
117
|
-
* use single-quotes
|
|
118
|
-
|
|
119
|
-
## v1.1.0
|
|
120
|
-
|
|
121
|
-
* Add tests, depend on is-absolute
|
|
122
|
-
|
|
123
|
-
## v1.0.9
|
|
124
|
-
|
|
125
|
-
* which.js: root is allowed to execute files owned by anyone
|
|
126
|
-
|
|
127
|
-
## v1.0.8
|
|
128
|
-
|
|
129
|
-
* don't use graceful-fs
|
|
130
|
-
|
|
131
|
-
## v1.0.7
|
|
132
|
-
|
|
133
|
-
* add license to package.json
|
|
134
|
-
|
|
135
|
-
## v1.0.6
|
|
136
|
-
|
|
137
|
-
* isc license
|
|
138
|
-
|
|
139
|
-
## 1.0.5
|
|
140
|
-
|
|
141
|
-
* Awful typo
|
|
142
|
-
|
|
143
|
-
## 1.0.4
|
|
144
|
-
|
|
145
|
-
* Test for path absoluteness properly
|
|
146
|
-
* win: Allow '' as a pathext if cmd has a . in it
|
|
147
|
-
|
|
148
|
-
## 1.0.3
|
|
149
|
-
|
|
150
|
-
* Remove references to execPath
|
|
151
|
-
* Make `which.sync()` work on Windows by honoring the PATHEXT variable.
|
|
152
|
-
* Make `isExe()` always return true on Windows.
|
|
153
|
-
* MIT
|
|
154
|
-
|
|
155
|
-
## 1.0.2
|
|
156
|
-
|
|
157
|
-
* Only files can be exes
|
|
158
|
-
|
|
159
|
-
## 1.0.1
|
|
160
|
-
|
|
161
|
-
* Respect the PATHEXT env for win32 support
|
|
162
|
-
* should 0755 the bin
|
|
163
|
-
* binary
|
|
164
|
-
* guts
|
|
165
|
-
* package
|
|
166
|
-
* 1st
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
The ISC License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
copyright notice and this permission notice appear in all copies.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# which
|
|
2
|
-
|
|
3
|
-
Like the unix `which` utility.
|
|
4
|
-
|
|
5
|
-
Finds the first instance of a specified executable in the PATH
|
|
6
|
-
environment variable. Does not cache the results, so `hash -r` is not
|
|
7
|
-
needed when the PATH changes.
|
|
8
|
-
|
|
9
|
-
## USAGE
|
|
10
|
-
|
|
11
|
-
```javascript
|
|
12
|
-
var which = require('which')
|
|
13
|
-
|
|
14
|
-
// async usage
|
|
15
|
-
which('node', function (er, resolvedPath) {
|
|
16
|
-
// er is returned if no "node" is found on the PATH
|
|
17
|
-
// if it is found, then the absolute path to the exec is returned
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
// or promise
|
|
21
|
-
which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... })
|
|
22
|
-
|
|
23
|
-
// sync usage
|
|
24
|
-
// throws if not found
|
|
25
|
-
var resolved = which.sync('node')
|
|
26
|
-
|
|
27
|
-
// if nothrow option is used, returns null if not found
|
|
28
|
-
resolved = which.sync('node', {nothrow: true})
|
|
29
|
-
|
|
30
|
-
// Pass options to override the PATH and PATHEXT environment vars.
|
|
31
|
-
which('node', { path: someOtherPath }, function (er, resolved) {
|
|
32
|
-
if (er)
|
|
33
|
-
throw er
|
|
34
|
-
console.log('found at %j', resolved)
|
|
35
|
-
})
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## CLI USAGE
|
|
39
|
-
|
|
40
|
-
Same as the BSD `which(1)` binary.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
usage: which [-as] program ...
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## OPTIONS
|
|
47
|
-
|
|
48
|
-
You may pass an options object as the second argument.
|
|
49
|
-
|
|
50
|
-
- `path`: Use instead of the `PATH` environment variable.
|
|
51
|
-
- `pathExt`: Use instead of the `PATHEXT` environment variable.
|
|
52
|
-
- `all`: Return all matches, instead of just the first one. Note that
|
|
53
|
-
this means the function returns an array of strings instead of a
|
|
54
|
-
single string.
|