-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 12.20 and move to ESM
- Loading branch information
1 parent
6ba1dc7
commit 32bffd7
Showing
10 changed files
with
100 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const sleep = () => { | ||
setTimeout(sleep, 10000); | ||
setTimeout(sleep, 10_000); | ||
}; | ||
|
||
sleep(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,51 @@ | ||
declare namespace psList { | ||
interface Options { | ||
/** | ||
Include other users' processes as well as your own. | ||
On Windows this has no effect and will always be the users' own processes. | ||
@default true | ||
*/ | ||
readonly all?: boolean; | ||
} | ||
|
||
interface ProcessDescriptor { | ||
readonly pid: number; | ||
readonly name: string; | ||
readonly ppid: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly cmd?: string; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly cpu?: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly memory?: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly uid?: number; | ||
} | ||
export interface Options { | ||
/** | ||
Include other users' processes as well as your own. | ||
On Windows this has no effect and will always be the users' own processes. | ||
@default true | ||
*/ | ||
readonly all?: boolean; | ||
} | ||
|
||
export interface ProcessDescriptor { | ||
readonly pid: number; | ||
readonly name: string; | ||
readonly ppid: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly cmd?: string; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly cpu?: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly memory?: number; | ||
|
||
/** | ||
Not supported on Windows. | ||
*/ | ||
readonly uid?: number; | ||
} | ||
|
||
/** | ||
Get running processes. | ||
@returns List of running processes. | ||
@returns A list of running processes. | ||
@example | ||
``` | ||
import psList = require('ps-list'); | ||
import psList from 'ps-list'; | ||
(async () => { | ||
console.log(await psList()); | ||
//=> [{pid: 3213, name: 'node', cmd: 'node test.js', ppid: 1, uid: 501, cpu: 0.1, memory: 1.5}, …] | ||
})(); | ||
console.log(await psList()); | ||
//=> [{pid: 3213, name: 'node', cmd: 'node test.js', ppid: 1, uid: 501, cpu: 0.1, memory: 1.5}, …] | ||
``` | ||
*/ | ||
declare function psList(options?: psList.Options): Promise<psList.ProcessDescriptor[]>; | ||
|
||
export = psList; | ||
export default function psList(options?: Options): Promise<ProcessDescriptor[]>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters