5.0.1 • Published 8 months ago

p-transform v5.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

p-transform

Promised out of order transform.

Usage

Builds a out-of-order Duplex using a p-queue parallel queue. transform implementation must be sync or return a promise. Callback is not supported.

Promisified pipeline and transform shortcut are provided for convenience.

import { OutOfOrder, transform, pipeline, passthrough, filter } from 'p-transform';

await pipeline(
  new OutOfOrder(
    { transform: async file => file },
    { concurrency: 7 },
  ).duplex(() => console.log('done')),
  passthrough(async file => {}, () => console.log('done')),
  filter(async file => true, () => console.log('done')),
  transform(async file => file, () => console.log('done')),
)

Debug

Use DEBUG=p-transform:* environment variable.

License

Apache-2.0

API

Classes

Constants

Functions

OutOfOrder

Kind: global class

new OutOfOrder(transform, queueOptions)

OutOfOrder

ParamTypeDescription
transformfunctionTransform.
queueOptionsObjectOptions forwarded to PQueue instance.

outOfOrder.duplex(end) ⇒ Duplex

Build Duplex.

Kind: instance method of OutOfOrder Returns: Duplex

ParamType
endfunction

pipeline

Promisified pipeline

Kind: global constant

transform(transform, end)

Shortcut to create a OutOfOrder with transform and end callback.

Kind: global function

ParamType
transformfunction
endfunction

passthrough(spy, end)

Shortcut to create a passthrough OutOfOrder with spy and end callback.

Kind: global function

ParamType
spyfunction
endfunction

filter(filter, end)

Shortcut to create a filter OutOfOrder with filter and end callback.

Kind: global function

ParamType
filterfunction
endfunction
5.0.1

8 months ago

5.0.0

8 months ago

4.1.6

8 months ago

4.1.4

2 years ago

4.1.3

2 years ago

4.1.5

2 years ago

4.1.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago