update samples
This commit is contained in:
parent
e6fb55eb1a
commit
2e5a6dbcc8
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.map(s => Promise.resolve(s + s)))
|
.pipe(strom.map(s => Promise.resolve(s + s)))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
const catProcess = require("child_process").exec("grep -o ab");
|
const catProcess = require("child_process").exec("grep -o ab");
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.collect({ objectMode: true }))
|
.pipe(strom.collect({ objectMode: true }))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const { Readable } = require("stream");
|
const { Readable } = require("stream");
|
||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
const source1 = new Readable();
|
const source1 = new Readable();
|
||||||
const source2 = new Readable();
|
const source2 = new Readable();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
const catProcess = require("child_process").exec("grep -o ab");
|
const catProcess = require("child_process").exec("grep -o ab");
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.filter(s => s !== "b"))
|
.pipe(strom.filter(s => s !== "b"))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "AA"])
|
strom.fromArray(["a", "AA"])
|
||||||
.pipe(strom.flatMap(s => new Array(s.length).fill(s)))
|
.pipe(strom.flatMap(s => new Array(s.length).fill(s)))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.join(","))
|
.pipe(strom.join(","))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
let f = async () => {
|
let f = async () => {
|
||||||
const source = strom.fromArray(["a", "b", "c"]);
|
const source = strom.fromArray(["a", "b", "c"]);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b"])
|
strom.fromArray(["a", "b"])
|
||||||
.pipe(strom.map(s => s.toUpperCase()))
|
.pipe(strom.map(s => s.toUpperCase()))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const { Readable } = require("stream");
|
const { Readable } = require("stream");
|
||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
const source1 = new Readable({ read() {} });
|
const source1 = new Readable({ read() {} });
|
||||||
const source2 = new Readable({ read() {} });
|
const source2 = new Readable({ read() {} });
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(['{ "a": "b" }'])
|
strom.fromArray(['{ "a": "b" }'])
|
||||||
.pipe(strom.parse())
|
.pipe(strom.parse())
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "cc"])
|
strom.fromArray(["a", "b", "cc"])
|
||||||
.pipe(strom.reduce((acc, s) => ({ ...acc, [s]: s.length }), {}))
|
.pipe(strom.reduce((acc, s) => ({ ...acc, [s]: s.length }), {}))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a1", "b22", "c333"])
|
strom.fromArray(["a1", "b22", "c333"])
|
||||||
.pipe(strom.replace(/b\d+/, "B"))
|
.pipe(strom.replace(/b\d+/, "B"))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray(["a,b", "c,d"])
|
strom.fromArray(["a,b", "c,d"])
|
||||||
.pipe(strom.split(","))
|
.pipe(strom.split(","))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom");
|
const strom = require("strom").strom();
|
||||||
|
|
||||||
strom.fromArray([{ a: "b" }])
|
strom.fromArray([{ a: "b" }])
|
||||||
.pipe(strom.stringify())
|
.pipe(strom.stringify())
|
||||||
|
Loading…
Reference in New Issue
Block a user