How to use the glob-stream.createStream function in glob-stream

To help you get started, we’ve selected a few glob-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mdittmer / web-apis / lib / idl / BlinkLinkedRunner.es6.js View on Github external
run() {
    // TODO: Do something more robust?
    if (this.running) throw new Error('BlinkLinkedRunner already running');
    this.running = true;

    // Clear runner-output-data.
    this.filesProcessed = [];
    this.urlsToFiles = {};
    this.urlsToParses = {};

    // Compose fresh set of memos for main pipeline computation(s).
    this.pipeline = this.createPipeline();

    // Find files for pipeline inputs
    this.globStream = gs.createStream(`${this.blinkPath}/**/*.idl`, [], {});
    this.globStream.on(
      'data',
      file => this.processFile(file.path.substr(`${this.blinkPath}/`.length))
    );

    // Return Promise handled by streaming input event listeners.
    return new Promise((resolve, reject) => {
      this.globStream.on('error', error => {
        return Promise.resolve(this.onError(resolve, reject, error));
      });
      this.globStream.on('end', data => {
        return Promise.all(this.eachFilePromises).then(
          this.onDataReady.bind(this, resolve, reject, data),
          this.onError.bind(this, resolve, reject)
        );
      });
github isiahmeadows / thallium / lib / cli / old / cli.js View on Github external
function (result, next) {
                    var callback = self.makeNext(next)

                    gs.createStream(result.files, {allowEmpty: true})
                    .on("error", callback)
                    .on("data", function (data) {
                        // This will never be equal if `this.data.config` is
                        // `null`.
                        /* eslint-disable global-require */

                        if (data !== self.data.config) require(data)

                        /* eslint-enable global-require */
                    })
                    .on("end", callback)
                },

glob-stream

Readable streamx interface over anymatch.

MIT
Latest version published 9 months ago

Package Health Score

77 / 100
Full package analysis