import { globber } from "https://deno.land/x/globber@0.1.0/src/globber.ts";
This produces an async iterable for searching through the provided patterns
relative to the cwd
. If cwd
is left blank then it defaults to Deno.cwd()
.
import { globber } from 'https://deno.land/x/globber/mod.ts';
for await (const entry of globber({ extensions: ['.jsonc', '.json'] })) {
const contents = await Deno.readTextFile(entry.absolute);
const json = JSON.parse(contents);
if (json.name === "amazing") {
// do something
break;
}
}
Parameters
options: GlobberProps