How to use the globby.stream function in globby

To help you get started, we’ve selected a few globby 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 unboundedsystems / adapt / scripts / starters.js View on Github external
await utils.withTmpDir(async (tmp) => {
            try {
                process.chdir(tmp);
                await adapt(["new", s.dir, "."]);
                for await (const pj of globby.stream("**/package.json", { absolute: true })) {
                    const pjDir = path.dirname(pj.toString());
                    await yarn([], { cwd: pjDir });
                    try {
                        await yarn([ "audit" ], { cwd: pjDir });
                    } catch (err) {
                        errors.push({
                            name: s.name,
                            file: pj.slice(tmp.length + 1),
                            stdout: err.stdout,
                            summary: utils.grep(err.stdout, /vulnerabilities found/g).join("\n"),
                        });
                    }
                }

            } finally {
                process.chdir(origDir);

globby

User-friendly glob matching

MIT
Latest version published 5 months ago

Package Health Score

81 / 100
Full package analysis