How to use the front-async.series function in front-async

To help you get started, we’ve selected a few front-async 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 quentez / talonjs / tests / quotations_tests.js View on Github external
return async.eachSeries(files, (file, nextFile) => {
          // We're only interested in email files.
          if (file.substr(-4) !== ".eml")
            return nextFile();

          return async.series({

            // Parse the EML file.
            emailText: next => utils.parseEmlText(path.join(standardRepliesPath, file), next),

            // Try and load the reply text for this message.
            replyText: next => utils.tryReadFile(path.join(standardRepliesPath, file.slice(0, -4) + "_reply_text"), next),

            // Compare the results.
            checkText: (next, results) => {
              // Try and extract the reply from the loaded message.
              const extractedText = quotations.extractFromPlain(results.emailText).body;

              // Compare the reply text and the extracted text.
              assert.equal((results.replyText || "Hello").replace(/\r\n/g, "\n").trim(), extractedText);
              return next();
            }

front-async

Higher-order functions and common patterns for asynchronous code

MIT
Latest version published 9 years ago

Package Health Score

60 / 100
Full package analysis

Popular front-async functions