Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/stream-spectrum
A variety of streams to be used in samples and/or tests.
https://github.com/thlorenz/stream-spectrum
Last synced: 15 days ago
JSON representation
A variety of streams to be used in samples and/or tests.
- Host: GitHub
- URL: https://github.com/thlorenz/stream-spectrum
- Owner: thlorenz
- License: mit
- Created: 2013-10-01T12:32:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T13:32:39.000Z (over 9 years ago)
- Last Synced: 2024-10-18T01:45:44.168Z (20 days ago)
- Language: JavaScript
- Homepage:
- Size: 156 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stream-spectrum
A variety of streams to be used in samples and/or tests.
## Installation
npm install stream-spectrum
## API
NumberReadable(opts) → {ReadableStream}Generates increasing numbers between the given from and to values.
Parameters:
Name
Type
Description
opts
Object
options
Properties
Name
Type
Argument
Description
from
Number
<optional>
start value to generate
to
Number
<optional>
end value to generate
throttle
Number
<optional>
number of milliseconds to take to generate each number
- Source:
Returns:
readable
Type
ReadableStream
ObjectReadable(opts) → {ReadableStream}Generates objects with a count property that increases between the given from and to values.
Parameters:
Name
Type
Description
opts
Object
options
Properties
Name
Type
Argument
Description
from
Number
<optional>
start value to generate
to
Number
<optional>
end value to generate
throttle
Number
<optional>
number of milliseconds to take to generate each number
- Source:
Returns:
readable
Type
ReadableStream
PowerTransform(opts) → {TransformStream}Transforms numbers into the power of each number.
Parameters:
Name
Type
Description
opts
Object
options
Properties
Name
Type
Argument
Description
throttle
Number
<optional>
number of milliseconds to take to transform each number into its power
- Source:
Returns:
transform
Type
TransformStream
RandomNumberReadable(opts) → {ReadableStream}Generates random numbers between the given min and max values.
Parameters:
Name
Type
Description
opts
Object
options
Properties
Name
Type
Argument
Description
min
Number
<optional>
minimum value to generate
max
Number
<optional>
maximum value to generate
throttle
Number
<optional>
number of milliseconds to take to generate each number
- Source:
Returns:
readable
Type
ReadableStream
TarpitWritable(opts) → {WritableStream}Just drops the values written to it.
Simulates processing time via throttle valueParameters:
Name
Type
Description
opts
Object
options
Properties
Name
Type
Argument
Description
debug
Boolean
<optional>
if true written values are logged to the console
throttle
Number
<optional>
number of milliseconds to delay each written chunk
- Source:
Returns:
writable
Type
WritableStream*generated with [docme](https://github.com/thlorenz/docme)*
## License
MIT