update samples

This commit is contained in:
Lewis Diamond 2020-07-04 11:06:41 -04:00
parent e6fb55eb1a
commit 2e5a6dbcc8
16 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b", "c"])
.pipe(strom.map(s => Promise.resolve(s + s)))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
const catProcess = require("child_process").exec("grep -o ab");
strom.fromArray(["a", "b", "c"])

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b", "c"])
.pipe(strom.collect({ objectMode: true }))

View File

@ -1,5 +1,5 @@
const { Readable } = require("stream");
const strom = require("strom");
const strom = require("strom").strom();
const source1 = new Readable();
const source2 = new Readable();

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
const catProcess = require("child_process").exec("grep -o ab");
strom.fromArray(["a", "b", "c"])

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b", "c"])
.pipe(strom.filter(s => s !== "b"))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "AA"])
.pipe(strom.flatMap(s => new Array(s.length).fill(s)))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b", "c"])
.pipe(strom.join(","))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
let f = async () => {
const source = strom.fromArray(["a", "b", "c"]);

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b"])
.pipe(strom.map(s => s.toUpperCase()))

View File

@ -1,5 +1,5 @@
const { Readable } = require("stream");
const strom = require("strom");
const strom = require("strom").strom();
const source1 = new Readable({ read() {} });
const source2 = new Readable({ read() {} });

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(['{ "a": "b" }'])
.pipe(strom.parse())

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a", "b", "cc"])
.pipe(strom.reduce((acc, s) => ({ ...acc, [s]: s.length }), {}))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a1", "b22", "c333"])
.pipe(strom.replace(/b\d+/, "B"))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray(["a,b", "c,d"])
.pipe(strom.split(","))

View File

@ -1,4 +1,4 @@
const strom = require("strom");
const strom = require("strom").strom();
strom.fromArray([{ a: "b" }])
.pipe(strom.stringify())