Update package to use itself in dev, update samples
This commit is contained in:
parent
fc5b96f725
commit
2fb7942d9c
@ -47,7 +47,7 @@
|
|||||||
"@types/sinon": "^7.0.13",
|
"@types/sinon": "^7.0.13",
|
||||||
"ava": "^2.4.0",
|
"ava": "^2.4.0",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"mhysa": "./",
|
"stromjs": "./",
|
||||||
"prettier": "^1.14.3",
|
"prettier": "^1.14.3",
|
||||||
"sinon": "^7.4.2",
|
"sinon": "^7.4.2",
|
||||||
"ts-node": "^8.3.0",
|
"ts-node": "^8.3.0",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
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)))
|
||||||
.pipe(strom.flatMap(s => Promise.resolve([s, s.toUpperCase()])))
|
.pipe(strom.flatMap(s => Promise.resolve([s, s.toUpperCase()])))
|
||||||
.pipe(strom.filter(s => Promise.resolve(s !== "bb")))
|
.pipe(strom.filter(s => Promise.resolve(s !== "bb")))
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
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"])
|
||||||
.pipe(strom.child(catProcess))
|
.pipe(strom.child(catProcess))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom
|
||||||
|
.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.collect({ objectMode: true }))
|
.pipe(strom.collect({ objectMode: true }))
|
||||||
.on("data", object => console.log(object));
|
.on("data", object => console.log(object));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const { Readable } = require("stream");
|
const { Readable } = require("stream");
|
||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
const source1 = new Readable();
|
const source1 = new Readable();
|
||||||
const source2 = new Readable();
|
const source2 = new Readable();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
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"])
|
||||||
.pipe(strom.duplex(catProcess.stdin, catProcess.stdout))
|
.pipe(strom.duplex(catProcess.stdin, catProcess.stdout))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom
|
||||||
|
.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.filter(s => s !== "b"))
|
.pipe(strom.filter(s => s !== "b"))
|
||||||
.pipe(strom.join(","))
|
.pipe(strom.join(","))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
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)))
|
||||||
.pipe(strom.join(","))
|
.pipe(strom.join(","))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a", "b", "c"])
|
strom
|
||||||
|
.fromArray(["a", "b", "c"])
|
||||||
.pipe(strom.join(","))
|
.pipe(strom.join(","))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
let f = async () => {
|
let f = async () => {
|
||||||
const source = strom.fromArray(["a", "b", "c"]);
|
const source = strom.fromArray(["a", "b", "c"]);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a", "b"])
|
strom
|
||||||
|
.fromArray(["a", "b"])
|
||||||
.pipe(strom.map(s => s.toUpperCase()))
|
.pipe(strom.map(s => s.toUpperCase()))
|
||||||
.pipe(strom.join(","))
|
.pipe(strom.join(","))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const { Readable } = require("stream");
|
const { Readable } = require("stream");
|
||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
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("stromjs").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
function sleep(time) {
|
function sleep(time) {
|
||||||
return time > 0 ? new Promise(resolve => setTimeout(resolve, time)) : null;
|
return time > 0 ? new Promise(resolve => setTimeout(resolve, time)) : null;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(['{ "a": "b" }'])
|
strom
|
||||||
|
.fromArray(['{ "a": "b" }'])
|
||||||
.pipe(strom.parse())
|
.pipe(strom.parse())
|
||||||
.on("data", object => console.log(object));
|
.on("data", object => console.log(object));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const strom = require("../dist/index.js");
|
const strom = require("stromjs");
|
||||||
|
|
||||||
function sleep(time) {
|
function sleep(time) {
|
||||||
return time > 0 ? new Promise(resolve => setTimeout(resolve, time)) : null;
|
return time > 0 ? new Promise(resolve => setTimeout(resolve, time)) : null;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
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 }), {}))
|
||||||
.pipe(strom.stringify())
|
.pipe(strom.stringify())
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a1", "b22", "c333"])
|
strom
|
||||||
|
.fromArray(["a1", "b22", "c333"])
|
||||||
.pipe(strom.replace(/b\d+/, "B"))
|
.pipe(strom.replace(/b\d+/, "B"))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray(["a,b", "c,d"])
|
strom
|
||||||
|
.fromArray(["a,b", "c,d"])
|
||||||
.pipe(strom.split(","))
|
.pipe(strom.split(","))
|
||||||
.pipe(strom.join("|"))
|
.pipe(strom.join("|"))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const strom = require("strom").strom();
|
const strom = require("stromjs");
|
||||||
|
|
||||||
strom.fromArray([{ a: "b" }])
|
strom
|
||||||
|
.fromArray([{ a: "b" }])
|
||||||
.pipe(strom.stringify())
|
.pipe(strom.stringify())
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
|
@ -1934,9 +1934,6 @@ merge2@^1.2.3, merge2@^1.3.0:
|
|||||||
resolved "https://npm.dev.jogogo.co/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81"
|
resolved "https://npm.dev.jogogo.co/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81"
|
||||||
integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==
|
integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==
|
||||||
|
|
||||||
mhysa@./:
|
|
||||||
version "2.0.0-alpha.1"
|
|
||||||
|
|
||||||
micromatch@^4.0.2:
|
micromatch@^4.0.2:
|
||||||
version "4.0.2"
|
version "4.0.2"
|
||||||
resolved "https://npm.dev.jogogo.co/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
|
resolved "https://npm.dev.jogogo.co/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
|
||||||
@ -2719,6 +2716,9 @@ strip-json-comments@~2.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||||
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
||||||
|
|
||||||
|
stromjs@./:
|
||||||
|
version "0.5.1"
|
||||||
|
|
||||||
supertap@^1.0.0:
|
supertap@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/supertap/-/supertap-1.0.0.tgz#bd9751c7fafd68c68cf8222a29892206a119fa9e"
|
resolved "https://registry.yarnpkg.com/supertap/-/supertap-1.0.0.tgz#bd9751c7fafd68c68cf8222a29892206a119fa9e"
|
||||||
|
Loading…
Reference in New Issue
Block a user