bare-process
Advanced tools
+10
-5
@@ -0,9 +1,12 @@ | ||
| import abort from 'bare-abort' | ||
| import EventEmitter, { EventMap } from 'bare-events' | ||
| import { | ||
| platform, | ||
| arch, | ||
| availableMemory, | ||
| constrainedMemory, | ||
| cpuUsage, | ||
| threadCpuUsage, | ||
| memoryUsage, | ||
| platform, | ||
| resourceUsage, | ||
| memoryUsage | ||
| threadCpuUsage | ||
| } from 'bare-os' | ||
@@ -31,4 +34,3 @@ import { ReadStream } from 'bare-tty' | ||
| interface Process<M extends ProcessEvents = ProcessEvents> | ||
| extends EventEmitter<M> { | ||
| interface Process<M extends ProcessEvents = ProcessEvents> extends EventEmitter<M> { | ||
| readonly stdin: ReadStream | Pipe | ||
@@ -64,5 +66,8 @@ readonly stdout: ReadStream | Pipe | ||
| abort: typeof abort | ||
| cpuUsage: typeof cpuUsage | ||
| threadCpuUsage: typeof threadCpuUsage | ||
| resourceUsage: typeof resourceUsage | ||
| availableMemory: typeof availableMemory | ||
| constrainedMemory: typeof constrainedMemory | ||
| memoryUsage: typeof memoryUsage | ||
@@ -69,0 +74,0 @@ |
+16
-9
@@ -0,1 +1,2 @@ | ||
| const abort = require('bare-abort') | ||
| const EventEmitter = require('bare-events') | ||
@@ -39,5 +40,3 @@ const Pipe = require('bare-pipe') | ||
| if (stdin === null) { | ||
| stdin = tty.isTTY(0) | ||
| ? new tty.ReadStream(0) | ||
| : new Pipe(0, { eagerOpen: false }) | ||
| stdin = tty.isTTY(0) ? new tty.ReadStream(0) : new Pipe(0, { eagerOpen: false }) | ||
| stdin.fd = 0 | ||
@@ -51,5 +50,3 @@ } | ||
| if (stdout === null) { | ||
| stdout = tty.isTTY(1) | ||
| ? new tty.WriteStream(1) | ||
| : new Pipe(1, { eagerOpen: false }) | ||
| stdout = tty.isTTY(1) ? new tty.WriteStream(1) : new Pipe(1, { eagerOpen: false }) | ||
| stdout.fd = 1 | ||
@@ -63,5 +60,3 @@ } | ||
| if (stderr === null) { | ||
| stderr = tty.isTTY(2) | ||
| ? new tty.WriteStream(2) | ||
| : new Pipe(2, { eagerOpen: false }) | ||
| stderr = tty.isTTY(2) ? new tty.WriteStream(2) : new Pipe(2, { eagerOpen: false }) | ||
| stderr.fd = 2 | ||
@@ -129,2 +124,6 @@ } | ||
| abort() { | ||
| abort() | ||
| } | ||
| exit(code) { | ||
@@ -170,2 +169,10 @@ Bare.exit(code) | ||
| availableMemory() { | ||
| return os.availableMemory() | ||
| } | ||
| constrainedMemory() { | ||
| return os.constrainedMemory() | ||
| } | ||
| memoryUsage() { | ||
@@ -172,0 +179,0 @@ return os.memoryUsage() |
+4
-3
| { | ||
| "name": "bare-process", | ||
| "version": "4.2.2", | ||
| "version": "4.3.0", | ||
| "description": "Node.js-compatible process control for Bare", | ||
@@ -36,6 +36,7 @@ "exports": { | ||
| "dependencies": { | ||
| "bare-abort": "^2.0.13", | ||
| "bare-env": "^3.0.0", | ||
| "bare-events": "^2.3.1", | ||
| "bare-hrtime": "^2.0.0", | ||
| "bare-os": "^3.5.0", | ||
| "bare-os": "^3.7.1", | ||
| "bare-pipe": "^4.0.0", | ||
@@ -48,4 +49,4 @@ "bare-signals": "^4.0.0", | ||
| "prettier": "^3.4.1", | ||
| "prettier-config-standard": "^7.0.0" | ||
| "prettier-config-holepunch": "^2.0.0" | ||
| } | ||
| } |
17993
1.97%228
4.11%8
14.29%+ Added
+ Added
Updated