"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); });