@sequencemedia/lsof 0.0.9 → 0.0.11
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/package.json +5 -5
- package/src/1/common.mjs +4 -4
- package/src/2/common.mjs +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/lsof",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"lsof",
|
|
6
6
|
"list open files"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"husky": "^9.1.7"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@sequencemedia/eslint-config-standard": "^0.2.
|
|
30
|
-
"@sequencemedia/eslint-config-typescript": "^0.1.
|
|
31
|
-
"@types/node": "^22.15.
|
|
29
|
+
"@sequencemedia/eslint-config-standard": "^0.2.56",
|
|
30
|
+
"@sequencemedia/eslint-config-typescript": "^0.1.87",
|
|
31
|
+
"@types/node": "^22.15.14",
|
|
32
32
|
"eslint": "^9.26.0",
|
|
33
|
-
"globals": "^16.
|
|
33
|
+
"globals": "^16.1.0"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": "./index.mjs",
|
package/src/1/common.mjs
CHANGED
|
@@ -143,7 +143,7 @@ function getCol (s) {
|
|
|
143
143
|
* @returns {Set<Set<Record<string, string | number>>>}
|
|
144
144
|
*/
|
|
145
145
|
export function getSet (value = '') {
|
|
146
|
-
const array = value.split(LF)
|
|
146
|
+
const array = value.trim().split(LF)
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* @type {Set<Set<Record<string, string | number>>>}
|
|
@@ -171,7 +171,7 @@ export function getSet (value = '') {
|
|
|
171
171
|
* @returns {Array<Array<Record<string, string | number>>>}
|
|
172
172
|
*/
|
|
173
173
|
export function getArray (value = '') {
|
|
174
|
-
const array = value.split(LF)
|
|
174
|
+
const array = value.trim().split(LF)
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* @type {Array<Array<Record<string, string | number>>>}
|
|
@@ -199,7 +199,7 @@ export function getArray (value = '') {
|
|
|
199
199
|
* @returns {Array<Array<Record<string, string | number>>>}
|
|
200
200
|
*/
|
|
201
201
|
export function getRows (value = '') {
|
|
202
|
-
const array = value.split(LF)
|
|
202
|
+
const array = value.trim().split(LF)
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* @type {Array<Array<Record<string, string | number>>>}
|
|
@@ -234,7 +234,7 @@ export function getLsof () {
|
|
|
234
234
|
* @returns {void}
|
|
235
235
|
*/
|
|
236
236
|
function complete (e, v = '') {
|
|
237
|
-
return (!e) ? resolve(v
|
|
237
|
+
return (!e) ? resolve(v) : reject(e)
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
execFile('lsof', ['-F', 'pcuftDsin'], OPTIONS, complete)
|
package/src/2/common.mjs
CHANGED
|
@@ -23,7 +23,7 @@ export const NAME = 'name'
|
|
|
23
23
|
* sizeOff: string | number,
|
|
24
24
|
* node: string | number,
|
|
25
25
|
* name: string
|
|
26
|
-
* }}
|
|
26
|
+
* }} ProcessDescriptorType
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
const PATTERN = /^\s*(?<command>[!-~]+)\s+(?<pid>\d+)\s+(?<user>\w+)\s+(?<fd>\s+|\w+)\s+(?<type>\s+|\w+)\s+(?<device>\s+|\d+,\d+|0x[\w\d]*)\s+(?<sizeOff>\s+|\w+|\d+)\s+(?<node>\s+|\d+)\s+(?<name>.*)/
|
|
@@ -115,7 +115,7 @@ export function getLsof () {
|
|
|
115
115
|
* @returns {void}
|
|
116
116
|
*/
|
|
117
117
|
function complete (e, v = '') {
|
|
118
|
-
return (!e) ? resolve(v
|
|
118
|
+
return (!e) ? resolve(v) : reject(e)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
execFile('lsof', OPTIONS, complete)
|