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.

23 lines
642 B
JavaScript

"use strict";
const Promise = require("bluebird");
const pipe = require("@promistream/pipe");
const walkFolder = require(".");
const map = require("@promistream/map");
const filter = require("@promistream/filter");
const find = require("@promistream/find");
return Promise.try(() => {
return pipe([
walkFolder(".", {
// NOTE: Make sure that your predicate always includes the initial path, or nothing will happen
throughStream: filter((path) => path === "." || path.includes("node_modules"))
}),
map((item) => item.path),
find((path) => path.includes("bluebird"))
]).read();
}).then((result) => {
console.log(result);
});