https://github.com/perry-mitchell/spout
Data transfer using pipes, connectors, filters, splits, joins and drains
https://github.com/perry-mitchell/spout
data-transfer data-transmission pipe pipeline
Last synced: 7 months ago
JSON representation
Data transfer using pipes, connectors, filters, splits, joins and drains
- Host: GitHub
- URL: https://github.com/perry-mitchell/spout
- Owner: perry-mitchell
- License: mit
- Created: 2018-09-11T19:31:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T10:01:10.000Z (almost 8 years ago)
- Last Synced: 2025-11-13T05:04:17.834Z (7 months ago)
- Topics: data-transfer, data-transmission, pipe, pipeline
- Language: JavaScript
- Size: 789 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Spout
> Data transfer across every medium
## About
Spout is a data transfer framework designed at making sending data between applications, machines and protocols easy. Spout is a JavaScript/NodeJS framework which is split into libraries targeting each platform. This is the core library that houses the fundamentals.
## Installation
Run the following to install Spout:
```shell
npm install spout --save
```
## Usage
The most basic component is `pipe` - Pipes are functions that accept data and move it onwards to a _target_. Targets can be other pipes, components or simple functions. Data is transferred throughout Spout within arrays.
```javascript
const { pipe } = require("spout");
const p = pipe(console.log);
p([1, 2, 3]);
p([4, 5]);
// Asynchronously logged: [1, 2, 3, 4, 5]
```
Pipes can be connected to other pipes and components. One such component is `transform`, which is essentially a pipe with a constructor more suited for providing a **transform function**. Each _point_ of data is passed through the transformer.
```javascript
const { pipe, transform } = require("spout");
const t = transform(x => x * 2, console.log);
t([1, 2]);
// Asynchronously logged: [2, 4]
const p = pipe(t);
p(8); // You can pass a single data point (non-array) as well
// Asynchronously logged: [16]
```