@steve02081504/virtual-console 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/main.mjs +5 -4
  2. package/package.json +1 -1
package/main.mjs CHANGED
@@ -90,8 +90,9 @@ export class VirtualConsole extends Console {
90
90
  if (this.options.recordOutput)
91
91
  this.outputs += chunk.toString()
92
92
  if (this.options.realConsoleOutput)
93
- targetStream.write(chunk, encoding)
94
- callback()
93
+ targetStream.write(chunk, encoding, callback)
94
+ else
95
+ callback()
95
96
  },
96
97
  })
97
98
 
@@ -121,8 +122,8 @@ export class VirtualConsole extends Console {
121
122
  return virtualStream
122
123
  }
123
124
 
124
- this._stdout = createVirtualStream(this.#base_console._stdout || process.stdout)
125
- this._stderr = createVirtualStream(this.#base_console._stderr || process.stderr)
125
+ this._stdout = createVirtualStream(this.#base_console?._stdout || process.stdout)
126
+ this._stderr = createVirtualStream(this.#base_console?._stderr || process.stderr)
126
127
  }
127
128
 
128
129
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steve02081504/virtual-console",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A virtual console for capturing and manipulating terminal output.",
5
5
  "main": "main.mjs",
6
6
  "type": "module",