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"])
|
||||
.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");
|
||||
|
||||
strom.fromArray(["a", "b", "c"])
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(["a", "b", "c"])
|
||||
.pipe(strom.collect({ objectMode: true }))
|
||||
|
@ -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();
|
||||
|
@ -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"])
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(["a", "b", "c"])
|
||||
.pipe(strom.filter(s => s !== "b"))
|
||||
|
@ -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)))
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(["a", "b", "c"])
|
||||
.pipe(strom.join(","))
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
let f = async () => {
|
||||
const source = strom.fromArray(["a", "b", "c"]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(["a", "b"])
|
||||
.pipe(strom.map(s => s.toUpperCase()))
|
||||
|
@ -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() {} });
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(['{ "a": "b" }'])
|
||||
.pipe(strom.parse())
|
||||
|
@ -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 }), {}))
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray(["a1", "b22", "c333"])
|
||||
.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"])
|
||||
.pipe(strom.split(","))
|
||||
|
@ -1,4 +1,4 @@
|
||||
const strom = require("strom");
|
||||
const strom = require("strom").strom();
|
||||
|
||||
strom.fromArray([{ a: "b" }])
|
||||
.pipe(strom.stringify())
|
||||
|
Loading…
Reference in New Issue
Block a user