Comparing version 4.36.1 to 4.37.0
@@ -8,4 +8,36 @@ import {Readable, Writable, Transform} from "stream"; | ||
type ThenFunction = (arg: any) => any; | ||
type Options = DataStreamOptions; | ||
interface ArrayOptions { | ||
concurrency?: number; | ||
signal?: AbortSignal; | ||
} | ||
type SignalOption = Pick<ArrayOptions, "signal">; | ||
declare class PromiseTransform implements Readable, Writable { | ||
[Symbol.asyncIterator](): AsyncIterableIterator<any>; | ||
[Symbol.asyncDispose](): Promise<void>; | ||
iterator(options?: { destroyOnReturn?: boolean; }): AsyncIterableIterator<any>; | ||
map(fn: (data: any, options?: SignalOption) => any, options?: ArrayOptions): never; | ||
filter(fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>, options?: ArrayOptions): never; | ||
forEach(fn: (data: any, options?: SignalOption) => void | Promise<void>, options?: ArrayOptions): never; | ||
toArray(options?: SignalOption): never; | ||
some(fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>, options?: ArrayOptions): never; | ||
find<T>(fn: (data: any, options?: SignalOption) => data is T, options?: ArrayOptions): never; | ||
find(fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>, options?: ArrayOptions): never; | ||
every(fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>, options?: ArrayOptions): never; | ||
flatMap(fn: (data: any, options?: SignalOption) => any, options?: ArrayOptions): never; | ||
drop(limit: number, options?: SignalOption): Readable; | ||
take(limit: number, options?: SignalOption): Readable; | ||
asIndexedPairs(options?: SignalOption): Readable; | ||
reduce<T = any>(fn: (previous: any, data: any, options?: SignalOption) => T, initial?: undefined, options?: SignalOption): never; | ||
reduce<T = any>(fn: (previous: T, data: any, options?: SignalOption) => T, initial: T, options?: SignalOption): never; | ||
[Symbol.asyncIterator](): AsyncIterableIterator<any>; | ||
compose<T extends NodeJS.ReadableStream>(stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, options?: { signal: AbortSignal; }): T; | ||
compose<T extends NodeJS.ReadableStream>(stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, options?: { signal: AbortSignal; }): T; | ||
writableNeedDrain: boolean; | ||
closed: boolean; | ||
errored: Error; | ||
[Symbol.asyncIterator](): AsyncIterableIterator<any>; | ||
readableAborted: boolean; | ||
@@ -37,3 +69,3 @@ readableDidRead: boolean; | ||
_destroy(error: Error, callback: (error?: Error) => void): void; | ||
destroy(error?: Error): void; | ||
destroy(error?: Error): this; | ||
readable: boolean; | ||
@@ -68,5 +100,5 @@ read(size?: number | undefined): string | Buffer; | ||
write(str: string, encoding?: string | undefined, cb?: ((err?: Error | null | undefined) => void) | undefined): boolean; | ||
end(cb?: (() => void) | undefined): void; | ||
end(data: string | Uint8Array, cb?: (() => void) | undefined): void; | ||
end(str: string, encoding?: string | undefined, cb?: (() => void) | undefined): void; | ||
end(cb?: () => void): this; | ||
end(data: string | Uint8Array, cb?: () => void): this; | ||
end(str: string, encoding?: string | undefined, cb?: () => void): this; | ||
addListener(event: string | symbol, listener: (...args: any[]) => void): this; | ||
@@ -190,2 +222,14 @@ on(event: string | symbol, listener: (...args: any[]) => void): this; | ||
declare class DataStream extends PromiseTransform { | ||
map(fn: (data: any, options?: SignalOption) => any, options: ArrayOptions): never; | ||
filter(fn: (data: any, options: SignalOption) => boolean | Promise<boolean>, options: ArrayOptions): never; | ||
forEach(fn: (data: any, options: SignalOption) => void | Promise<void>, options: ArrayOptions): never; | ||
toArray(options: SignalOption): never; | ||
some(fn: (data: any, options: SignalOption) => boolean | Promise<boolean>, options: ArrayOptions): never; | ||
find<T>(fn: (data: any, options: SignalOption) => data is T, options: ArrayOptions): never; | ||
find(fn: (data: any, options: SignalOption) => boolean | Promise<boolean>, options: ArrayOptions): never; | ||
every(fn: (data: any, options: SignalOption) => boolean | Promise<boolean>, options: ArrayOptions): never; | ||
flatMap(fn: (data: any, options: SignalOption) => any, options: ArrayOptions): never; | ||
reduce<T = any>(fn: (previous: any, data: any, options: SignalOption) => T, initial: undefined, options: SignalOption): never; | ||
reduce<T = any>(fn: (previous: T, data: any, options: SignalOption) => T, initial: T, options: SignalOption): never; | ||
/** | ||
@@ -202,3 +246,3 @@ * DataStream is the primary stream type for Scramjet. When you parse your stream, just pipe it you can then perform calculations on the data objects streamed through your flow. Use as: ```javascript const { DataStream } = require('scramjet'); await (DataStream.from(aStream) // create a DataStream .map(findInFiles) // read some data asynchronously .map(sendToAPI) // send the data somewhere .run()); // wait until end ``` | ||
*/ | ||
static from(input: any[] | Iterable<any> | AsyncGeneratorFunction | GeneratorFunction | AsyncFunction | Promise<any> | Function | string | Readable, options?: DataStreamOptions | Writable, ...args: any[]): DataStream; | ||
static from(input: any[] | Iterable<any> | AsyncGeneratorFunction | GeneratorFunction | AsyncFunction | Promise<any> | Function | string | Readable, options?: Options | Writable, ...args: any[]): DataStream; | ||
@@ -312,3 +356,3 @@ /** | ||
*/ | ||
setOptions(options: DataStreamOptions): this; | ||
setOptions(options: Options): this; | ||
@@ -374,3 +418,3 @@ /** | ||
*/ | ||
static fromArray(array: any[], options?: DataStreamOptions): DataStream; | ||
static fromArray(array: any[], options?: Options): DataStream; | ||
@@ -382,3 +426,3 @@ /** | ||
*/ | ||
static fromIterator(iterator: Iterator<any>, options?: DataStreamOptions): DataStream; | ||
static fromIterator(iterator: Iterator<any>, options?: Options): DataStream; | ||
@@ -532,3 +576,3 @@ /** | ||
*/ | ||
distribute(affinity?: AffinityCallback | Function | number, clusterFunc?: Function | DataStreamOptions, options?: DataStreamOptions): this; | ||
distribute(affinity?: AffinityCallback | Function | number, clusterFunc?: Function | Options, options?: Options): this; | ||
@@ -548,3 +592,3 @@ /** | ||
*/ | ||
separate(affinity: AffinityCallback, createOptions?: DataStreamOptions, ClassType?: Function): MultiStream; | ||
separate(affinity: AffinityCallback, createOptions?: Options, ClassType?: Function): MultiStream; | ||
@@ -551,0 +595,0 @@ /** |
@@ -67,3 +67,3 @@ # Use scramjet from scratch | ||
StringStream.from(async () => get('https://www.some.server.net/some.file.txt'))) | ||
StringStream.from(async () => get('https://www.some.server.net/some.file.txt')) | ||
.lines() | ||
@@ -70,0 +70,0 @@ .parse(x => x.split('\t')) |
@@ -479,3 +479,3 @@ const scramjet = require("./core"); | ||
const item = await iterator.next(); | ||
if (item.value && !ref.write(item.value)) await ref.whenDrained(); | ||
@@ -1070,3 +1070,3 @@ if (item.done) return res(); | ||
* @return {StringStream} output stream | ||
* | ||
* | ||
* @test test/methods/data-stream-jsonstringify.js | ||
@@ -1073,0 +1073,0 @@ */ |
{ | ||
"name": "scramjet", | ||
"version": "4.36.1", | ||
"version": "4.37.0", | ||
"description": "Lightweight and real-time data functional stream programming framework like event-stream, written in ES6 using async await with multi-threading and typescript support", | ||
@@ -64,2 +64,3 @@ "main": "lib/index.js", | ||
"lint": "gulp lint", | ||
"scm_clean": "gulp scm_clean", | ||
"preversion": "gulp prerelease" | ||
@@ -70,3 +71,3 @@ }, | ||
"type": "git", | ||
"url": "https://github.com/scramjetorg/scramjet.git" | ||
"url": "https://github.com/scramjetorg/framework-v4.git" | ||
}, | ||
@@ -80,10 +81,10 @@ "engines": { | ||
"devDependencies": { | ||
"@otris/jsdoc-tsd": "^2.0.4", | ||
"@types/node": "^16.11.7", | ||
"check-dts": "^0.6.3", | ||
"decache": "^4.6.0", | ||
"dmd": "^6.0.0", | ||
"eslint": "^8.2.0", | ||
"@otris/jsdoc-tsd": "^3.0.0", | ||
"@types/node": "^20.6.0", | ||
"check-dts": "^0.7.2", | ||
"decache": "^4.6.2", | ||
"dmd": "^6.2.0", | ||
"eslint": "^8.49.0", | ||
"eslint-config-scramjet": "^3.0.0", | ||
"fancy-log": "^1.3.3", | ||
"fancy-log": "^2.0.0", | ||
"gulp": "^4.0.2", | ||
@@ -94,19 +95,19 @@ "gulp-cli": "^2.3.0", | ||
"gulp-shell": "^0.8.0", | ||
"jsdoc": "^3.6.7", | ||
"jsdoc-api": "^7.1.0", | ||
"jsdoc-parse": "^6.0.1", | ||
"node-fetch": "^3.1.0", | ||
"nodeunit-tape-compat": "^1.3.77", | ||
"replace-in-file": "^6.3.2", | ||
"shelljs": "^0.8.4", | ||
"tape": "^5.3.2", | ||
"jsdoc": "^4.0.2", | ||
"jsdoc-api": "^8.0.0", | ||
"jsdoc-parse": "^6.2.0", | ||
"node-fetch": "<3", | ||
"nodeunit-tape-compat": "^1.3.80", | ||
"replace-in-file": "^7.0.1", | ||
"shelljs": "^0.8.5", | ||
"tape": "^5.6.6", | ||
"through2": "^4.0.2", | ||
"typescript": "^4.5.2", | ||
"vinyl": "^2.2.1" | ||
"typescript": "^5.2.2", | ||
"vinyl": "^3.0.0" | ||
}, | ||
"dependencies": { | ||
"papaparse": "^5.3.1", | ||
"rereadable-stream": "^1.4.12", | ||
"scramjet-core": "^4.32.1" | ||
"papaparse": "^5.4.1", | ||
"rereadable-stream": "^1.4.14", | ||
"scramjet-core": "^4.32.12" | ||
} | ||
} |
@@ -5,7 +5,8 @@ ![Scramjet Logo](https://assets.scramjet.org/images/framework-logo-256.svg) | ||
[![Master Build Status](https://travis-ci.org/scramjetorg/scramjet.svg?branch=master)](https://travis-ci.org/scramjetorg/scramjet) | ||
[![Develop Build Status](https://travis-ci.org/scramjetorg/scramjet.svg?branch=develop)](https://travis-ci.org/scramjetorg/scramjet) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet?ref=badge_shield) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/scramjetorg/scramjet/badge.svg)](https://snyk.io/test/github/scramjetorg/scramjet) | ||
[![DeepScan grade](https://deepscan.io/api/projects/2632/branches/17801/badge/grade.svg)](https://deepscan.io/dashboard#view=project&pid=2632&bid=17801) | ||
[![npm version](https://img.shields.io/npm/v/scramjet)](https://www.npmjs.com/scramjet) | ||
[![npm downloads](https://img.shields.io/npm/dt/scramjet)](https://www.npmjs.com/scramjet) | ||
[![last commit](https://img.shields.io/github/last-commit/scramjetorg/framework-v4)](https://github.com/scramjetorg/framework-v4) | ||
[![Build status](https://img.shields.io/github/checks-status/scramjetorg/framework-v4/master?label=build)](https://github.com/scramjetorg/framework-v4) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/scramjetorg/framework-v4/badge.svg)](https://snyk.io/test/github/scramjetorg/framework-v4) | ||
[![Discord](https://img.shields.io/discord/925384545342201896?label=discord)](https://discord.gg/52USU8q7AX) | ||
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7F7V65C43EBMW) | ||
@@ -25,4 +26,7 @@ | ||
The benchmarks are published in the [scramjet-benchmark repo](https://github.com/scramjetorg/scramjet-benchmark). | ||
**We are working on the next version of Scramjet Framework and are very eager for your feedback! You can see and test `pre-v5`**: | ||
* JavaScript/TypeScript version in [scramjeorg/framework-js](https://github.com/scramjetorg/framework-js) repository and | ||
* a brand new Python version in [scramjetorg/framework-python](https://github.com/scramjetorg/framework-python)! | ||
## Example | ||
@@ -64,3 +68,3 @@ | ||
You can now run stream processing programs with our Scramjet Transform Hub. It will allow you to deploy and execute programs | ||
You can now run stream processing programs with our Scramjet Transform Hub. It will allow you to deploy and execute programs | ||
on local and remote environments of your choice and it's as easy as: | ||
@@ -76,3 +80,3 @@ | ||
* onour website [scramjet.org](https://scramjet.org), | ||
* on our website [scramjet.org](https://scramjet.org), | ||
* the documentation repo [scramjetorg/scramjet-cloud-docs](https://github.com/scramjetorg/scramjet-cloud-docs) | ||
@@ -510,3 +514,3 @@ * the source code and development guide [scramjetorg/transform-hub](https://github.com/scramjetorg/transform-hub) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet-core.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet-core?ref=badge_large) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fscramjetorg%2Fscramjet?ref=badge_large) | ||
@@ -517,3 +521,3 @@ ## Help wanted | ||
If you want to help and be part of the Scramjet team, please reach out to us, [on slack](https://join.slack.com/t/scramjetframework/shared_invite/zt-bb16pluv-XlICrq5Khuhbq5beenP2Fg) or email us: [opensource@scramjet.org](opensource@scramjet.org). | ||
If you want to help and be part of the Scramjet team, please reach out to us, [on discord](https://discord.gg/52USU8q7AX) or email us: [opensource@scramjet.org](opensource@scramjet.org). | ||
@@ -520,0 +524,0 @@ ## Donation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Found 1 instance in 1 package
330497
2813
525
4
Updatedpapaparse@^5.4.1
Updatedrereadable-stream@^1.4.14
Updatedscramjet-core@^4.32.12