@push.rocks/smartstream 2.0.7 → 2.0.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.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartstream',
6
- version: '2.0.6',
6
+ version: '2.0.7',
7
7
  description: 'simplifies access to node streams'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLG1DQUFtQztDQUNqRCxDQUFBIn0=
@@ -1,3 +1,4 @@
1
+ export * from './smartstream.classes.passthrough.js';
1
2
  export * from './smartstream.classes.smartstream.js';
2
3
  export * from './smartstream.classes.streamwrapper.js';
3
4
  export * from './smartstream.classes.streamintake.js';
package/dist_ts/index.js CHANGED
@@ -1,5 +1,6 @@
1
+ export * from './smartstream.classes.passthrough.js';
1
2
  export * from './smartstream.classes.smartstream.js';
2
3
  export * from './smartstream.classes.streamwrapper.js';
3
4
  export * from './smartstream.classes.streamintake.js';
4
5
  export * from './smartstream.duplex.js';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsd0NBQXdDLENBQUM7QUFDdkQsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLHlCQUF5QixDQUFDIn0=
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsc0NBQXNDLENBQUM7QUFDckQsY0FBYyx3Q0FBd0MsQ0FBQztBQUN2RCxjQUFjLHVDQUF1QyxDQUFDO0FBQ3RELGNBQWMseUJBQXlCLENBQUMifQ==
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import * as plugins from './smartstream.plugins.js';
4
+ export declare class PassThrough extends plugins.stream.Duplex {
5
+ constructor(options?: plugins.stream.DuplexOptions);
6
+ _read(size: number): void;
7
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
8
+ }
@@ -0,0 +1,18 @@
1
+ import * as plugins from './smartstream.plugins.js';
2
+ export class PassThrough extends plugins.stream.Duplex {
3
+ constructor(options) {
4
+ super(options);
5
+ }
6
+ _read(size) {
7
+ // No-op: Data written will be automatically available for reading.
8
+ }
9
+ _write(chunk, encoding, callback) {
10
+ if (this.push(chunk, encoding)) {
11
+ callback();
12
+ }
13
+ else {
14
+ this.once('drain', callback);
15
+ }
16
+ }
17
+ }
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJlYW0uY2xhc3Nlcy5wYXNzdGhyb3VnaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyZWFtLmNsYXNzZXMucGFzc3Rocm91Z2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSwwQkFBMEIsQ0FBQztBQUVwRCxNQUFNLE9BQU8sV0FBWSxTQUFRLE9BQU8sQ0FBQyxNQUFNLENBQUMsTUFBTTtJQUNwRCxZQUFZLE9BQXNDO1FBQ2hELEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNqQixDQUFDO0lBRUQsS0FBSyxDQUFDLElBQVk7UUFDaEIsbUVBQW1FO0lBQ3JFLENBQUM7SUFFRCxNQUFNLENBQUMsS0FBVSxFQUFFLFFBQXdCLEVBQUUsUUFBd0M7UUFDbkYsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxRQUFRLENBQUMsRUFBRTtZQUM5QixRQUFRLEVBQUUsQ0FBQztTQUNaO2FBQU07WUFDTCxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxRQUFRLENBQUMsQ0FBQztTQUM5QjtJQUNILENBQUM7Q0FDRiJ9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartstream",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "private": false,
5
5
  "description": "simplifies access to node streams",
6
6
  "main": "dist_ts/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartstream',
6
- version: '2.0.7',
6
+ version: '2.0.8',
7
7
  description: 'simplifies access to node streams'
8
8
  }
package/ts/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './smartstream.classes.passthrough.js';
1
2
  export * from './smartstream.classes.smartstream.js';
2
3
  export * from './smartstream.classes.streamwrapper.js';
3
4
  export * from './smartstream.classes.streamintake.js';
@@ -0,0 +1,19 @@
1
+ import * as plugins from './smartstream.plugins.js';
2
+
3
+ export class PassThrough extends plugins.stream.Duplex {
4
+ constructor(options?: plugins.stream.DuplexOptions) {
5
+ super(options);
6
+ }
7
+
8
+ _read(size: number): void {
9
+ // No-op: Data written will be automatically available for reading.
10
+ }
11
+
12
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void {
13
+ if (this.push(chunk, encoding)) {
14
+ callback();
15
+ } else {
16
+ this.once('drain', callback);
17
+ }
18
+ }
19
+ }