p-transform
Promised out of order transform.
Last updated 3 years ago by mshima .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install p-transform 
SYNC missed versions from official npm registry.

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

OutOfOrder

Constants

pipeline

Promisified pipeline

Functions

transform(transform, end)

Shortcut to create a OutOfOrder with transform and end callback

passthrough(spy, end)

Shortcut to create a passthrough OutOfOrder with spy and end callback

filter(filter, end)

Shortcut to create a filter OutOfOrder with filter and end callback

OutOfOrder

Kind: global class

new OutOfOrder(transform[, queueOptions])

OutOfOrder

Param Type Description
[transform] function Transform.
[queueOptions] Object Options forwarded to PQueue instance.

outOfOrder.duplex(end) ⇒ Duplex

Build Duplex.

Kind: instance method of OutOfOrder Returns: Duplex

Param Type
end function

pipeline

Promisified pipeline

Kind: global constant

transform(transform, end)

Shortcut to create a OutOfOrder with transform and end callback.

Kind: global function

Param Type
transform function
end function

passthrough(spy, end)

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

Kind: global function

Param Type
spy function
end function

filter(filter, end)

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

Kind: global function

Param Type
filter function
end function

Current Tags

  • 5.0.1                                ...           latest (a year ago)

25 Versions

  • 5.0.1                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.1.6                                ...           a year ago
  • 4.1.5                                ...           2 years ago
  • 4.1.4                                ...           2 years ago
  • 4.1.3                                ...           3 years ago
  • 4.1.2                                ...           3 years ago
  • 4.1.1                                ...           3 years ago
  • 4.1.0                                ...           3 years ago
  • 4.0.5                                ...           3 years ago
  • 4.0.4                                ...           3 years ago
  • 4.0.3                                ...           3 years ago
  • 4.0.2                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (3)
Dev Dependencies (8)

Copyright 2013 - present © cnpmjs.org | Home |