You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
492 B
JavaScript
21 lines
492 B
JavaScript
"use strict";
|
|
|
|
const Promise = require("bluebird");
|
|
const pipe = require("@promistream/pipe");
|
|
const fromIterable = require("@promistream/from-iterable");
|
|
const splitLines = require("./");
|
|
const collect = require("@promistream/collect");
|
|
|
|
Promise.try(() => {
|
|
return pipe([
|
|
fromIterable([
|
|
"line 1\nline 2\nline 3\nli",
|
|
"ne 4\nline 5"
|
|
]),
|
|
splitLines(),
|
|
collect()
|
|
]).read();
|
|
}).then((result) => {
|
|
console.log(result); // [ "line 1", "line 2", "line 3", "line 4", "line 5" ]
|
|
});
|