New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stream-executor

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-executor - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

28

package.json
{
"name": "stream-executor",
"version": "1.3.2",
"version": "1.4.0",
"description": "functional stream programming",

@@ -30,17 +30,17 @@ "main": "./lib/index.js",

"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@types/jest": "^25.2.3",
"@typescript-eslint/eslint-plugin": "^3.0.2",
"@typescript-eslint/parser": "^3.0.2",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@types/jest": "^26.0.15",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"eslint": "^7.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^26.0.1",
"jest-cli": "^26.0.1",
"prettier": "^2.0.5",
"ts-jest": "^26.0.0",
"typescript": "^3.9.3"
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^26.6.1",
"jest-cli": "^26.6.1",
"prettier": "^2.1.2",
"ts-jest": "^26.4.3",
"typescript": "^4.0.5"
},

@@ -47,0 +47,0 @@ "files": [

@@ -121,3 +121,28 @@ # stream-executor

# 3. asyncChain stream
### using stream-executor
```ts
import { createStream, tap, map } from 'stream-executor'
const result = await createStream(1)
.asyncChain(
tap(async (it) => console.log(await it)), // 1
map(async (it) => await callAPI(it)),
map(async (it) => parseToModel(await it)) // Record<string, any>
)
.execute()
console.log(result) // Record<string, any>
```
### not using stream-executor
```ts
(async () => {
let result
const value = 1
result = await callAPI(value)
result = await parseToModel(result)
console.log(result)
})()
```
# Important

@@ -182,18 +207,3 @@ ## 1. About `createStream`

## 4. Use asynchronous execution in `createStream().chain()`:
- Call `asAsync` method before `execute` method
```ts
import { createStream, tap, map } from 'stream-executor'
const result = await createStream(1)
.chain(
tap((it) => console.log(it)), // 1
map(async (it) => await callAPI(it)),
map(async (it) => parseToModel(await it)) // Record<string, any>
)
.asAsync()
.execute()
console.log(result) // Record<string, any>
```
## 5. Abount the arguments of execute()
## 4. Abount the arguments of execute()
- Set the arguments of execute method if you'd like to customize error handling, please

@@ -213,3 +223,3 @@ ```ts

## 6. Replace `chain` or `batch` executor
## 5. Replace `chain` or `batch` executor
- Set `option.chainClass` or `option.batchClass` if you would change execution process, please

@@ -216,0 +226,0 @@ - These Classes are initialized with initialValue as an argument

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc