Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
851a96c014 | |||
4ea42cb9fb | |||
41eed6423d | |||
0e067004a4 | |||
9fe222b500 | |||
05e9067a34 | |||
2aff46eb0e | |||
6aa4b86598 | |||
af30268551 | |||
e562e8f099 | |||
01f4a53b5b | |||
f42b77986f | |||
b7ef295757 | |||
2818420ee9 | |||
d759e2a562 | |||
65a97c9ee0 | |||
b036bfcb92 | |||
c0304d1d10 | |||
26880f9b71 | |||
aa7c30a096 | |||
083673f02c | |||
93bcc03e72 |
20
.gitignore
vendored
20
.gitignore
vendored
@ -1,4 +1,20 @@
|
||||
node_modules/
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
coverage/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
# custom
|
119
.gitlab-ci.yml
119
.gitlab-ci.yml
@ -1,33 +1,80 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmts
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- pages
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
testLEGACY:
|
||||
stage: test
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci test legacy
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testSTABLE:
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
@ -35,29 +82,59 @@ testSTABLE:
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmpage
|
||||
stage: pages
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npmpage --publish gitlab
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
allow_failure: true
|
||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": ["/npmextra.json"],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"npmci": {
|
||||
"type": "object",
|
||||
"description": "settings for npmci"
|
||||
},
|
||||
"gitzone": {
|
||||
"type": "object",
|
||||
"description": "settings for gitzone",
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
37
README.md
37
README.md
@ -1,37 +0,0 @@
|
||||
# smartstream
|
||||
simplifies access to node streams, TypeScript ready!
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smartstream)
|
||||
[](https://gitlab.com/pushrocks/smartstream)
|
||||
[](https://github.com/pushrocks/smartstream)
|
||||
[](https://pushrocks.gitlab.io/smartstream/gitbook)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/smartstream/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartstream/commits/master)
|
||||
[](https://david-dm.org/pushrocks/smartstream)
|
||||
[](https://www.bithound.io/github/pushrocks/smartstream/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartstream)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
We recommend the use of TypeScript for best in class intellisense support.
|
||||
|
||||
```typescript
|
||||
import { Smartstream } from 'smartstream'
|
||||
import * as gUglify from 'gulp-uglify'
|
||||
|
||||
let mySmartstream = new Smartstream([
|
||||
gulp.src(['./file1.js','./file2.js']),
|
||||
gUglify(),
|
||||
gulp.dest('./some/output/path')
|
||||
])
|
||||
|
||||
mySmartstream.onError((err) => { /* handle error */ }) // handles all errors in stream
|
||||
myStream.onCustomEvent('myeventname', (args...) => { /* Do something */ }) // emit an custom event anywhere in your stream
|
||||
mySmartstream.run().then(() => {/* do something when stream is finished */})
|
||||
```
|
||||
|
40
dist/index.d.ts
vendored
40
dist/index.d.ts
vendored
@ -1,40 +0,0 @@
|
||||
/// <reference types="q" />
|
||||
/// <reference types="node" />
|
||||
import * as plugins from './smartstream.plugins';
|
||||
import { Transform } from 'stream';
|
||||
export interface IErrorFunction {
|
||||
(err: any): any;
|
||||
}
|
||||
export interface ICustomEventFunction {
|
||||
(): any;
|
||||
}
|
||||
export interface ICustomEventObject {
|
||||
eventName: string;
|
||||
eventFunction: ICustomEventFunction;
|
||||
}
|
||||
/**
|
||||
* class Smartstream handles
|
||||
*/
|
||||
export declare class Smartstream {
|
||||
private streamArray;
|
||||
private customEventObjectArray;
|
||||
private streamStartedDeferred;
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
constructor(streamArrayArg: any[]);
|
||||
/**
|
||||
* make something with the stream itself
|
||||
*/
|
||||
streamStarted(): plugins.q.Promise<any>;
|
||||
/**
|
||||
* attach listener to custom event
|
||||
*/
|
||||
onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction): void;
|
||||
/**
|
||||
* run the stream
|
||||
* @returns Promise
|
||||
*/
|
||||
run(): plugins.q.Promise<void>;
|
||||
}
|
||||
export declare let cleanPipe: () => Transform;
|
82
dist/index.js
vendored
82
dist/index.js
vendored
@ -1,82 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smartstream.plugins");
|
||||
/**
|
||||
* class Smartstream handles
|
||||
*/
|
||||
class Smartstream {
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
constructor(streamArrayArg) {
|
||||
this.streamArray = [];
|
||||
this.customEventObjectArray = [];
|
||||
this.streamStartedDeferred = plugins.q.defer();
|
||||
this.streamArray = streamArrayArg;
|
||||
}
|
||||
/**
|
||||
* make something with the stream itself
|
||||
*/
|
||||
streamStarted() {
|
||||
return this.streamStartedDeferred.promise;
|
||||
}
|
||||
/**
|
||||
* attach listener to custom event
|
||||
*/
|
||||
onCustomEvent(eventNameArg, eventFunctionArg) {
|
||||
this.customEventObjectArray.push({
|
||||
eventName: eventNameArg,
|
||||
eventFunction: eventFunctionArg
|
||||
});
|
||||
}
|
||||
/**
|
||||
* run the stream
|
||||
* @returns Promise
|
||||
*/
|
||||
run() {
|
||||
let done = plugins.q.defer();
|
||||
// clone Array
|
||||
let streamExecutionArray = [];
|
||||
for (let streamItem of this.streamArray) {
|
||||
streamExecutionArray.push(streamItem);
|
||||
}
|
||||
// combine the stream
|
||||
let finalStream = null;
|
||||
let firstIteration = true;
|
||||
for (let stream of streamExecutionArray) {
|
||||
if (firstIteration === true) {
|
||||
finalStream = stream;
|
||||
}
|
||||
stream.on('error', (err) => {
|
||||
done.reject(err);
|
||||
});
|
||||
for (let customEventObject of this.customEventObjectArray) {
|
||||
stream.on(customEventObject.eventName, customEventObject.eventFunction);
|
||||
}
|
||||
if (!firstIteration) {
|
||||
finalStream = finalStream.pipe(stream);
|
||||
}
|
||||
firstIteration = false;
|
||||
}
|
||||
this.streamStartedDeferred.resolve();
|
||||
finalStream.on('end', function () {
|
||||
done.resolve();
|
||||
});
|
||||
finalStream.on('close', function () {
|
||||
done.resolve();
|
||||
});
|
||||
finalStream.on('finish', function () {
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
}
|
||||
}
|
||||
exports.Smartstream = Smartstream;
|
||||
exports.cleanPipe = () => {
|
||||
return plugins.through2.obj((file, enc, cb) => {
|
||||
cb();
|
||||
}, (cb) => {
|
||||
cb();
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGlEQUFnRDtBQW1CaEQ7O0dBRUc7QUFDSDtJQUtFOztPQUVHO0lBQ0gsWUFBWSxjQUFxQjtRQVB6QixnQkFBVyxHQUFHLEVBQUUsQ0FBQTtRQUNoQiwyQkFBc0IsR0FBeUIsRUFBRSxDQUFBO1FBQ2pELDBCQUFxQixHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUE7UUFNL0MsSUFBSSxDQUFDLFdBQVcsR0FBRyxjQUFjLENBQUE7SUFDbkMsQ0FBQztJQUVEOztPQUVHO0lBQ0gsYUFBYTtRQUNYLE1BQU0sQ0FBQyxJQUFJLENBQUMscUJBQXFCLENBQUMsT0FBTyxDQUFBO0lBQzNDLENBQUM7SUFFRDs7T0FFRztJQUNILGFBQWEsQ0FBQyxZQUFvQixFQUFFLGdCQUFzQztRQUN4RSxJQUFJLENBQUMsc0JBQXNCLENBQUMsSUFBSSxDQUFDO1lBQy9CLFNBQVMsRUFBRSxZQUFZO1lBQ3ZCLGFBQWEsRUFBRSxnQkFBZ0I7U0FDaEMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztJQUVEOzs7T0FHRztJQUNILEdBQUc7UUFDRCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBUSxDQUFBO1FBRWxDLGNBQWM7UUFDZCxJQUFJLG9CQUFvQixHQUFHLEVBQUUsQ0FBQTtRQUM3QixHQUFHLENBQUMsQ0FBQyxJQUFJLFVBQVUsSUFBSSxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztZQUFDLG9CQUFvQixDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQTtRQUFDLENBQUM7UUFFbEYscUJBQXFCO1FBQ3JCLElBQUksV0FBVyxHQUFHLElBQUksQ0FBQTtRQUN0QixJQUFJLGNBQWMsR0FBWSxJQUFJLENBQUE7UUFDbEMsR0FBRyxDQUFDLENBQUMsSUFBSSxNQUFNLElBQUksb0JBQW9CLENBQUMsQ0FBQyxDQUFDO1lBQ3hDLEVBQUUsQ0FBQyxDQUFDLGNBQWMsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDO2dCQUM1QixXQUFXLEdBQUcsTUFBTSxDQUFBO1lBQ3RCLENBQUM7WUFDRCxNQUFNLENBQUMsRUFBRSxDQUFDLE9BQU8sRUFBRSxDQUFDLEdBQUc7Z0JBQ3JCLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUE7WUFDbEIsQ0FBQyxDQUFDLENBQUE7WUFDRixHQUFHLENBQUMsQ0FBQyxJQUFJLGlCQUFpQixJQUFJLElBQUksQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDLENBQUM7Z0JBQzFELE1BQU0sQ0FBQyxFQUFFLENBQUMsaUJBQWlCLENBQUMsU0FBUyxFQUFFLGlCQUFpQixDQUFDLGFBQWEsQ0FBQyxDQUFBO1lBQ3pFLENBQUM7WUFDRCxFQUFFLENBQUMsQ0FBQyxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUM7Z0JBQ3BCLFdBQVcsR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFBO1lBQ3hDLENBQUM7WUFDRCxjQUFjLEdBQUcsS0FBSyxDQUFBO1FBQ3hCLENBQUM7UUFFRCxJQUFJLENBQUMscUJBQXFCLENBQUMsT0FBTyxFQUFFLENBQUE7UUFFcEMsV0FBVyxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUU7WUFDcEIsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFBO1FBQ2hCLENBQUMsQ0FBQyxDQUFBO1FBQ0YsV0FBVyxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUU7WUFDdEIsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFBO1FBQ2hCLENBQUMsQ0FBQyxDQUFBO1FBQ0YsV0FBVyxDQUFDLEVBQUUsQ0FBQyxRQUFRLEVBQUU7WUFDdkIsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFBO1FBQ2hCLENBQUMsQ0FBQyxDQUFBO1FBQ0YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUE7SUFDckIsQ0FBQztDQUNGO0FBeEVELGtDQXdFQztBQUVVLFFBQUEsU0FBUyxHQUFHO0lBQ3JCLE1BQU0sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FDekIsQ0FBQyxJQUFJLEVBQUUsR0FBRyxFQUFFLEVBQUU7UUFDWixFQUFFLEVBQUUsQ0FBQTtJQUNOLENBQUMsRUFDRCxDQUFDLEVBQUU7UUFDRCxFQUFFLEVBQUUsQ0FBQTtJQUNOLENBQUMsQ0FDRixDQUFBO0FBQ0gsQ0FBQyxDQUFBIn0=
|
3
dist/smartstream.plugins.d.ts
vendored
3
dist/smartstream.plugins.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
import 'typings-global';
|
||||
export import q = require('q');
|
||||
export import through2 = require('through2');
|
6
dist/smartstream.plugins.js
vendored
6
dist/smartstream.plugins.js
vendored
@ -1,6 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
exports.q = require("q");
|
||||
exports.through2 = require("through2");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJlYW0ucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyZWFtLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQkFBdUI7QUFDdkIseUJBQThCO0FBQzlCLHVDQUE0QyJ9
|
@ -1,7 +1,17 @@
|
||||
{
|
||||
"npmci": {
|
||||
"globalNpmTools": [
|
||||
"npmts"
|
||||
]
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartstream",
|
||||
"description": "simplifies access to node streams",
|
||||
"npmPackagename": "@push.rocks/smartstream",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
52
package.json
52
package.json
@ -1,11 +1,14 @@
|
||||
{
|
||||
"name": "smartstream",
|
||||
"version": "1.0.8",
|
||||
"description": "simplifies access to node streams, TypeScript ready!",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"name": "@push.rocks/smartstream",
|
||||
"version": "2.0.4",
|
||||
"private": false,
|
||||
"description": "simplifies access to node streams",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -18,16 +21,33 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartstream#README",
|
||||
"devDependencies": {
|
||||
"@types/should": "^8.1.30",
|
||||
"npmts-g": "^6.0.0",
|
||||
"should": "^11.2.0",
|
||||
"typings-test": "^1.0.3"
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@push.rocks/smartfile": "^10.0.28",
|
||||
"@push.rocks/tapbundle": "^5.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/q": "0.x.x",
|
||||
"@types/through2": "^2.0.32",
|
||||
"q": "^1.4.1",
|
||||
"through2": "^2.0.3",
|
||||
"typings-global": "^1.0.14"
|
||||
}
|
||||
"@push.rocks/smartpromise": "^4.0.3",
|
||||
"@push.rocks/smartrx": "^3.0.3",
|
||||
"@types/from2": "^2.3.2",
|
||||
"@types/through2": "^2.0.38",
|
||||
"from2": "^2.3.0",
|
||||
"through2": "^4.0.2"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
}
|
||||
|
4854
pnpm-lock.yaml
generated
Normal file
4854
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
54
readme.md
Normal file
54
readme.md
Normal file
@ -0,0 +1,54 @@
|
||||
# @pushrocks/smartstream
|
||||
simplifies access to node streams
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartstream)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartstream)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smartstream)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartstream/)
|
||||
|
||||
## Status for master
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
```typescript
|
||||
import { Smartstream } from 'smartstream'
|
||||
import * as gUglify from 'gulp-uglify'
|
||||
|
||||
let mySmartstream = new Smartstream([
|
||||
gulp.src(['./file1.js','./file2.js']),
|
||||
gUglify(),
|
||||
gulp.dest('./some/output/path')
|
||||
])
|
||||
|
||||
mySmartstream.onError((err) => { /* handle error */ }) // handles all errors in stream
|
||||
myStream.onCustomEvent('myeventname', (args...) => { /* Do something */ }) // emit an custom event anywhere in your stream
|
||||
mySmartstream.run().then(() => {/* do something when stream is finished */})
|
||||
```
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
6210
test/assets/readabletext.txt
Normal file
6210
test/assets/readabletext.txt
Normal file
File diff suppressed because it is too large
Load Diff
51
test/assets/writabletext.txt
Normal file
51
test/assets/writabletext.txt
Normal file
@ -0,0 +1,51 @@
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
hi+wow
|
||||
noice
|
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
||||
import 'typings-test';
|
19
test/test.js
19
test/test.js
@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-test");
|
||||
const fs = require("fs");
|
||||
const smartstream = require("../dist/index");
|
||||
let testSmartstream;
|
||||
describe('smartstream', function () {
|
||||
it('should combine a stream', function (done) {
|
||||
this.timeout(5000);
|
||||
testSmartstream = new smartstream.Smartstream([
|
||||
fs.createReadStream('./test/assets/test.md'),
|
||||
fs.createWriteStream('./test/assets/testCopy.md')
|
||||
]);
|
||||
testSmartstream.run().then(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx3QkFBcUI7QUFDckIseUJBQXlCO0FBR3pCLDZDQUE0QztBQUU1QyxJQUFJLGVBQXdDLENBQUE7QUFFNUMsUUFBUSxDQUFDLGFBQWEsRUFBRTtJQUNwQixFQUFFLENBQUMseUJBQXlCLEVBQUUsVUFBUyxJQUFJO1FBQ3ZDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7UUFDbEIsZUFBZSxHQUFHLElBQUksV0FBVyxDQUFDLFdBQVcsQ0FBQztZQUMxQyxFQUFFLENBQUMsZ0JBQWdCLENBQUMsdUJBQXVCLENBQUM7WUFDNUMsRUFBRSxDQUFDLGlCQUFpQixDQUFDLDJCQUEyQixDQUFDO1NBQ3BELENBQUMsQ0FBQTtRQUNGLGVBQWUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxJQUFJLENBQUM7WUFDdkIsSUFBSSxFQUFFLENBQUE7UUFDVixDQUFDLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFDLENBQUEifQ==
|
68
test/test.streamfunction.ts
Normal file
68
test/test.streamfunction.ts
Normal file
@ -0,0 +1,68 @@
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
|
||||
import * as smartstream from '../ts/index.js';
|
||||
|
||||
let testIntake: smartstream.StreamIntake<string>;
|
||||
|
||||
tap.test('should handle a read stream', async (tools) => {
|
||||
const counter = 0;
|
||||
const testSmartstream = new smartstream.StreamWrapper([
|
||||
smartfile.fsStream.createReadStream('./test/assets/readabletext.txt'),
|
||||
smartstream.createDuplexStream<Buffer, Buffer>(
|
||||
async (chunkStringArg: Buffer, streamTools) => {
|
||||
// do something with the stream here
|
||||
const result = chunkStringArg.toString().substr(0, 100);
|
||||
streamTools.pipeMore('wow =========== \n');
|
||||
return Buffer.from(result);
|
||||
},
|
||||
async (tools) => {
|
||||
// tools.pipeMore('hey, this is the end')
|
||||
return Buffer.from('this is the end');
|
||||
},
|
||||
{ objectMode: false }
|
||||
),
|
||||
smartstream.createDuplexStream<Buffer, string>(async (chunkStringArg) => {
|
||||
console.log(chunkStringArg.toString());
|
||||
return null;
|
||||
}),
|
||||
smartstream.cleanPipe(),
|
||||
]);
|
||||
await testSmartstream.run();
|
||||
});
|
||||
|
||||
tap.test('should create a valid Intake', async (tools) => {
|
||||
testIntake = new smartstream.StreamIntake<string>();
|
||||
testIntake
|
||||
.getReadable()
|
||||
.pipe(
|
||||
smartstream.createDuplexStream<string, string>(
|
||||
async (chunkString) => {
|
||||
await tools.delayFor(100);
|
||||
console.log(chunkString);
|
||||
return chunkString;
|
||||
},
|
||||
async () => {
|
||||
return 'noice';
|
||||
}
|
||||
)
|
||||
)
|
||||
.pipe(smartfile.fsStream.createWriteStream('./test/assets/writabletext.txt'));
|
||||
const testFinished = tools.defer();
|
||||
let counter = 0;
|
||||
testIntake.pushNextObservable.subscribe(() => {
|
||||
if (counter < 50) {
|
||||
counter++;
|
||||
testIntake.pushData('hi');
|
||||
testIntake.pushData('+wow');
|
||||
testIntake.pushData('\n');
|
||||
} else {
|
||||
testIntake.signalEnd();
|
||||
testFinished.resolve();
|
||||
}
|
||||
});
|
||||
await testFinished.promise;
|
||||
testIntake.signalEnd();
|
||||
});
|
||||
|
||||
tap.start();
|
29
test/test.ts
29
test/test.ts
@ -1,20 +1,15 @@
|
||||
import 'typings-test'
|
||||
import fs = require('fs')
|
||||
import * as should from 'should'
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as smartstream from '../dist/index'
|
||||
import * as smartstream from '../ts/smartstream.classes.streamwrapper.js';
|
||||
|
||||
let testSmartstream: smartstream.Smartstream
|
||||
let testSmartstream: smartstream.StreamWrapper;
|
||||
tap.test('should combine a stream', async () => {
|
||||
testSmartstream = new smartstream.StreamWrapper([
|
||||
smartfile.fsStream.createReadStream('./test/assets/test.md'),
|
||||
smartfile.fsStream.createWriteStream('./test/assets/testCopy.md'),
|
||||
]);
|
||||
await testSmartstream.run();
|
||||
});
|
||||
|
||||
describe('smartstream', function() {
|
||||
it('should combine a stream', function(done){
|
||||
this.timeout(5000)
|
||||
testSmartstream = new smartstream.Smartstream([
|
||||
fs.createReadStream('./test/assets/test.md'),
|
||||
fs.createWriteStream('./test/assets/testCopy.md')
|
||||
])
|
||||
testSmartstream.run().then(() => {
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
tap.start();
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartstream',
|
||||
version: '2.0.4',
|
||||
description: 'simplifies access to node streams'
|
||||
}
|
109
ts/index.ts
109
ts/index.ts
@ -1,106 +1,3 @@
|
||||
import * as plugins from './smartstream.plugins'
|
||||
|
||||
// interfaces
|
||||
import { Transform } from 'stream'
|
||||
|
||||
|
||||
export interface IErrorFunction {
|
||||
(err): any
|
||||
}
|
||||
|
||||
export interface ICustomEventFunction {
|
||||
(): any
|
||||
}
|
||||
|
||||
export interface ICustomEventObject {
|
||||
eventName: string
|
||||
eventFunction: ICustomEventFunction
|
||||
}
|
||||
|
||||
/**
|
||||
* class Smartstream handles
|
||||
*/
|
||||
export class Smartstream {
|
||||
private streamArray = []
|
||||
private customEventObjectArray: ICustomEventObject[] = []
|
||||
private streamStartedDeferred = plugins.q.defer()
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
constructor(streamArrayArg: any[]) {
|
||||
this.streamArray = streamArrayArg
|
||||
}
|
||||
|
||||
/**
|
||||
* make something with the stream itself
|
||||
*/
|
||||
streamStarted(): plugins.q.Promise<any> {
|
||||
return this.streamStartedDeferred.promise
|
||||
}
|
||||
|
||||
/**
|
||||
* attach listener to custom event
|
||||
*/
|
||||
onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction) {
|
||||
this.customEventObjectArray.push({
|
||||
eventName: eventNameArg,
|
||||
eventFunction: eventFunctionArg
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* run the stream
|
||||
* @returns Promise
|
||||
*/
|
||||
run(): plugins.q.Promise<void> {
|
||||
let done = plugins.q.defer<void>()
|
||||
|
||||
// clone Array
|
||||
let streamExecutionArray = []
|
||||
for (let streamItem of this.streamArray) { streamExecutionArray.push(streamItem) }
|
||||
|
||||
// combine the stream
|
||||
let finalStream = null
|
||||
let firstIteration: boolean = true
|
||||
for (let stream of streamExecutionArray) {
|
||||
if (firstIteration === true) {
|
||||
finalStream = stream
|
||||
}
|
||||
stream.on('error', (err) => {
|
||||
done.reject(err)
|
||||
})
|
||||
for (let customEventObject of this.customEventObjectArray) {
|
||||
stream.on(customEventObject.eventName, customEventObject.eventFunction)
|
||||
}
|
||||
if (!firstIteration) {
|
||||
finalStream = finalStream.pipe(stream)
|
||||
}
|
||||
firstIteration = false
|
||||
}
|
||||
|
||||
this.streamStartedDeferred.resolve()
|
||||
|
||||
finalStream.on('end', function () {
|
||||
done.resolve()
|
||||
})
|
||||
finalStream.on('close', function () {
|
||||
done.resolve()
|
||||
})
|
||||
finalStream.on('finish', function () {
|
||||
done.resolve()
|
||||
})
|
||||
return done.promise
|
||||
}
|
||||
}
|
||||
|
||||
export let cleanPipe = () => {
|
||||
return plugins.through2.obj(
|
||||
(file, enc, cb) => {
|
||||
cb()
|
||||
},
|
||||
(cb) => {
|
||||
cb()
|
||||
}
|
||||
)
|
||||
}
|
||||
export * from './smartstream.classes.streamwrapper.js';
|
||||
export * from './smartstream.classes.streamintake.js';
|
||||
export * from './smartstream.duplex.js';
|
66
ts/smartstream.classes.streamintake.ts
Normal file
66
ts/smartstream.classes.streamintake.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import * as plugins from './smartstream.plugins.js';
|
||||
|
||||
export class StreamIntake<T> {
|
||||
private signalEndBoolean = false;
|
||||
private chunkStore: T[] = [];
|
||||
|
||||
public pushNextObservable = new plugins.smartrx.ObservableIntake<any>();
|
||||
|
||||
private pushedNextDeferred = plugins.smartpromise.defer();
|
||||
|
||||
private readableStream = plugins.from2.obj(async (size, next) => {
|
||||
// console.log('get next');
|
||||
// execute without backpressure
|
||||
while (this.chunkStore.length > 0) {
|
||||
next(null, this.chunkStore.shift());
|
||||
}
|
||||
if (this.signalEndBoolean) {
|
||||
next(null, null);
|
||||
}
|
||||
|
||||
// lets trigger backpressure handling
|
||||
this.pushNextObservable.push('please push next');
|
||||
await this.pushedNextDeferred.promise;
|
||||
this.pushedNextDeferred = plugins.smartpromise.defer();
|
||||
|
||||
// execute with backpressure
|
||||
while (this.chunkStore.length > 0) {
|
||||
next(null, this.chunkStore.shift());
|
||||
}
|
||||
if (this.signalEndBoolean) {
|
||||
next(null, null);
|
||||
}
|
||||
});
|
||||
|
||||
constructor() {
|
||||
this.pushNextObservable.push('please push next');
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a new style readble stream
|
||||
*/
|
||||
public getReadable() {
|
||||
const readable = new plugins.stream.Readable({
|
||||
objectMode: true,
|
||||
});
|
||||
return readable.wrap(this.readableStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an oldstyle readble stream
|
||||
*/
|
||||
public getReadableStream() {
|
||||
return this.readableStream;
|
||||
}
|
||||
|
||||
public pushData(chunkData: T) {
|
||||
this.chunkStore.push(chunkData);
|
||||
this.pushedNextDeferred.resolve();
|
||||
}
|
||||
|
||||
public signalEnd() {
|
||||
this.signalEndBoolean = true;
|
||||
this.pushedNextDeferred.resolve();
|
||||
this.pushNextObservable.signalComplete();
|
||||
}
|
||||
}
|
107
ts/smartstream.classes.streamwrapper.ts
Normal file
107
ts/smartstream.classes.streamwrapper.ts
Normal file
@ -0,0 +1,107 @@
|
||||
import * as plugins from './smartstream.plugins.js';
|
||||
|
||||
// interfaces
|
||||
import { Transform } from 'stream';
|
||||
|
||||
export interface IErrorFunction {
|
||||
(err: Error): any;
|
||||
}
|
||||
|
||||
export interface ICustomEventFunction {
|
||||
(): any;
|
||||
}
|
||||
|
||||
export interface ICustomEventObject {
|
||||
eventName: string;
|
||||
eventFunction: ICustomEventFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* class Smartstream handles
|
||||
*/
|
||||
export class StreamWrapper {
|
||||
private streamArray: Array<plugins.stream.Duplex> = [];
|
||||
private customEventObjectArray: ICustomEventObject[] = [];
|
||||
private streamStartedDeferred = plugins.smartpromise.defer();
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
constructor(streamArrayArg: any[]) {
|
||||
this.streamArray = streamArrayArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* make something with the stream itself
|
||||
*/
|
||||
streamStarted(): Promise<any> {
|
||||
return this.streamStartedDeferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* attach listener to custom event
|
||||
*/
|
||||
onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction) {
|
||||
this.customEventObjectArray.push({
|
||||
eventName: eventNameArg,
|
||||
eventFunction: eventFunctionArg,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* run the stream
|
||||
* @returns Promise
|
||||
*/
|
||||
run(): Promise<void> {
|
||||
const done = plugins.smartpromise.defer<void>();
|
||||
|
||||
// clone Array
|
||||
const streamExecutionArray: Array<plugins.stream.Duplex> = [];
|
||||
for (const streamItem of this.streamArray) {
|
||||
streamExecutionArray.push(streamItem);
|
||||
}
|
||||
|
||||
// combine the stream
|
||||
let finalStream = null;
|
||||
let firstIteration: boolean = true;
|
||||
for (const stream of streamExecutionArray) {
|
||||
if (firstIteration === true) {
|
||||
finalStream = stream;
|
||||
}
|
||||
stream.on('error', (err) => {
|
||||
done.reject(err);
|
||||
});
|
||||
for (const customEventObject of this.customEventObjectArray) {
|
||||
stream.on(customEventObject.eventName, customEventObject.eventFunction);
|
||||
}
|
||||
if (!firstIteration) {
|
||||
finalStream = finalStream.pipe(stream);
|
||||
}
|
||||
firstIteration = false;
|
||||
}
|
||||
|
||||
this.streamStartedDeferred.resolve();
|
||||
|
||||
finalStream.on('end', () => {
|
||||
done.resolve();
|
||||
});
|
||||
finalStream.on('close', () => {
|
||||
done.resolve();
|
||||
});
|
||||
finalStream.on('finish', () => {
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
}
|
||||
}
|
||||
|
||||
export let cleanPipe = () => {
|
||||
return plugins.through2.obj(
|
||||
(file, enc, cb) => {
|
||||
cb();
|
||||
},
|
||||
(cb) => {
|
||||
cb();
|
||||
}
|
||||
);
|
||||
};
|
83
ts/smartstream.duplex.ts
Normal file
83
ts/smartstream.duplex.ts
Normal file
@ -0,0 +1,83 @@
|
||||
import * as plugins from './smartstream.plugins.js';
|
||||
|
||||
export interface ITruncateFunc {
|
||||
(): void;
|
||||
}
|
||||
|
||||
export interface IPipeMoreFunc {
|
||||
(pipeObject: any): void;
|
||||
}
|
||||
|
||||
export interface IStreamTools {
|
||||
truncate: ITruncateFunc;
|
||||
pipeMore: IPipeMoreFunc;
|
||||
}
|
||||
|
||||
export interface IStreamFunction<T, rT> {
|
||||
(chunkArg: T, toolsArg: IStreamTools): Promise<rT>;
|
||||
}
|
||||
|
||||
export interface IStreamEndFunction<rT> {
|
||||
(toolsArg: IStreamTools): Promise<rT>;
|
||||
}
|
||||
|
||||
export interface IStreamOptions {
|
||||
objectMode?: boolean;
|
||||
readableObjectMode?: boolean;
|
||||
writableObjectMode?: boolean;
|
||||
}
|
||||
|
||||
export let createDuplexStream = <T, rT>(
|
||||
funcArg: IStreamFunction<T, rT>,
|
||||
endFuncArg?: IStreamEndFunction<rT>,
|
||||
optionsArg: IStreamOptions = {
|
||||
objectMode: false,
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true,
|
||||
}
|
||||
) => {
|
||||
return plugins.through2(
|
||||
optionsArg,
|
||||
function (chunk, enc, cb) {
|
||||
let truncated = false;
|
||||
const tools: IStreamTools = {
|
||||
truncate: () => {
|
||||
truncated = true;
|
||||
cb(null, null);
|
||||
},
|
||||
pipeMore: (pipeObject) => {
|
||||
this.push(pipeObject);
|
||||
},
|
||||
};
|
||||
const asyncWrapper = async () => {
|
||||
const resultChunk: rT = await funcArg(chunk, tools);
|
||||
if (!truncated) {
|
||||
cb(null, resultChunk);
|
||||
}
|
||||
};
|
||||
asyncWrapper().catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
function (cb) {
|
||||
const tools: IStreamTools = {
|
||||
truncate: () => {
|
||||
cb();
|
||||
},
|
||||
pipeMore: (pushArg) => {
|
||||
this.push(pushArg);
|
||||
},
|
||||
};
|
||||
const asyncWrapper = async () => {
|
||||
if (endFuncArg) {
|
||||
const result = await endFuncArg(tools);
|
||||
this.push(result);
|
||||
}
|
||||
cb();
|
||||
};
|
||||
asyncWrapper().catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
@ -1,3 +1,16 @@
|
||||
import 'typings-global'
|
||||
export import q = require('q')
|
||||
export import through2 = require('through2')
|
||||
// node native
|
||||
import * as stream from 'stream';
|
||||
|
||||
export { stream };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
import * as smartrx from '@push.rocks/smartrx';
|
||||
|
||||
export { smartpromise, smartrx };
|
||||
|
||||
// thirdparty
|
||||
import from2 from 'from2';
|
||||
import through2 from 'through2';
|
||||
|
||||
export { from2, through2 };
|
||||
|
9
tsconfig.json
Normal file
9
tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
236
yarn.lock
236
yarn.lock
@ -1,236 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/mocha@^2.2.31":
|
||||
version "2.2.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.39.tgz#f68d63db8b69c38e9558b4073525cf96c4f7a829"
|
||||
|
||||
"@types/node@*":
|
||||
version "7.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.5.tgz#96a0f0a618b7b606f1ec547403c00650210bfbb7"
|
||||
|
||||
"@types/q@0.x.x":
|
||||
version "0.0.32"
|
||||
resolved "https://registry.yarnpkg.com/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5"
|
||||
|
||||
"@types/shelljs@^0.3.33":
|
||||
version "0.3.33"
|
||||
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.3.33.tgz#df613bddb88225ed09ce5c835f620dcaaf155e6b"
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/should@^8.1.30":
|
||||
version "8.1.30"
|
||||
resolved "https://registry.yarnpkg.com/@types/should/-/should-8.1.30.tgz#e6b4f3ca4fb0799f6ce3303f3a8c003df6585aa3"
|
||||
|
||||
"@types/through2@^2.0.32":
|
||||
version "2.0.32"
|
||||
resolved "https://registry.yarnpkg.com/@types/through2/-/through2-2.0.32.tgz#470024450f1ab7640f19f9ebf42d3da574c26129"
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
balanced-match@^0.4.1:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
||||
|
||||
brace-expansion@^1.0.0:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
|
||||
dependencies:
|
||||
balanced-match "^0.4.1"
|
||||
concat-map "0.0.1"
|
||||
|
||||
buffer-shims@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
glob@^7.0.0:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.2"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@~2.0.1:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
interpret@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
|
||||
minimatch@^3.0.2:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
|
||||
dependencies:
|
||||
brace-expansion "^1.0.0"
|
||||
|
||||
npmts-g@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/npmts-g/-/npmts-g-6.0.0.tgz#491fd50f110967f1b68f14237e7ea5157bf4ddb3"
|
||||
dependencies:
|
||||
"@types/shelljs" "^0.3.33"
|
||||
semver "^5.3.0"
|
||||
shelljs "^0.7.5"
|
||||
typings-global "^1.0.14"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
path-parse@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
||||
|
||||
process-nextick-args@~1.0.6:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
||||
|
||||
q@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
|
||||
|
||||
readable-stream@^2.1.5:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
|
||||
dependencies:
|
||||
buffer-shims "^1.0.0"
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.1"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~1.0.6"
|
||||
string_decoder "~0.10.x"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
rechoir@^0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
||||
dependencies:
|
||||
resolve "^1.1.6"
|
||||
|
||||
resolve@^1.1.6:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235"
|
||||
dependencies:
|
||||
path-parse "^1.0.5"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
|
||||
|
||||
shelljs@^0.7.4, shelljs@^0.7.5:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
|
||||
dependencies:
|
||||
glob "^7.0.0"
|
||||
interpret "^1.0.0"
|
||||
rechoir "^0.6.2"
|
||||
|
||||
should-equal@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-1.0.1.tgz#0b6e9516f2601a9fb0bb2dcc369afa1c7e200af7"
|
||||
dependencies:
|
||||
should-type "^1.0.0"
|
||||
|
||||
should-format@^3.0.2:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1"
|
||||
dependencies:
|
||||
should-type "^1.3.0"
|
||||
should-type-adaptors "^1.0.1"
|
||||
|
||||
should-type-adaptors@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/should-type-adaptors/-/should-type-adaptors-1.0.1.tgz#efe5553cdf68cff66e5c5f51b712dc351c77beaa"
|
||||
dependencies:
|
||||
should-type "^1.3.0"
|
||||
should-util "^1.0.0"
|
||||
|
||||
should-type@^1.0.0, should-type@^1.3.0, should-type@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3"
|
||||
|
||||
should-util@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.0.tgz#c98cda374aa6b190df8ba87c9889c2b4db620063"
|
||||
|
||||
should@^11.2.0:
|
||||
version "11.2.0"
|
||||
resolved "https://registry.yarnpkg.com/should/-/should-11.2.0.tgz#7afca3182c234781d786d2278a87805b5ecf0409"
|
||||
dependencies:
|
||||
should-equal "^1.0.0"
|
||||
should-format "^3.0.2"
|
||||
should-type "^1.4.0"
|
||||
should-type-adaptors "^1.0.1"
|
||||
should-util "^1.0.0"
|
||||
|
||||
string_decoder@~0.10.x:
|
||||
version "0.10.31"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
||||
|
||||
through2@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
|
||||
dependencies:
|
||||
readable-stream "^2.1.5"
|
||||
xtend "~4.0.1"
|
||||
|
||||
typings-global@*, typings-global@^1.0.14:
|
||||
version "1.0.14"
|
||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.14.tgz#ab682720a03d6b9278869fb5c30c30d7dc61d12c"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
shelljs "^0.7.4"
|
||||
|
||||
typings-test@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/typings-test/-/typings-test-1.0.3.tgz#fbab895eb3f0c44842e73db059f65946b971e369"
|
||||
dependencies:
|
||||
"@types/mocha" "^2.2.31"
|
||||
typings-global "*"
|
||||
|
||||
util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
xtend@~4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
Reference in New Issue
Block a user