How to use the filehound.any function in filehound

To help you get started, we’ve selected a few filehound 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 horcrux2301 / AFCP / lib / cp-automation.js View on Github external
function(resolve, reject) {
        var filesArray = [];
        const files1 = FileHound.create()
          .depth(0)
          .paths(xx)
          .match('myOutput*')
          .find();

        const files2 = FileHound.create()
          .depth(0)
          .paths(xx)
          .match('output*')
          .find();

        const files = FileHound.any(files1, files2)
          .then((file) => {
            Object.keys(file).map((i) => {
              let file_here = file[i];
              var number = file_here.substring(
                file_here.lastIndexOf("/") + 1,
                file_here.lastIndexOf(".")
              );
              var name = number.substring(0, 8);
              if (name === "myOutput") {
                number = number.substring(8);
                //        console.log(number);
                filesArray.push({ in: file_here,
                  out: "",
                  number: number
                });
              }

filehound

Find files the easy way

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Popular filehound functions