Skip to main content
Module

x/aleph/std.ts>path.globToRegExp

The Full-stack Framework in Deno.
Very Popular
Go to Latest
function path.globToRegExp
import { path } from "https://deno.land/x/aleph@v0.1.6/std.ts";
const { globToRegExp } = path;

Convert a glob string to a regular expressions.

 // Looking for all the `ts` files:
 walkSync(".", {
   match: [globToRegExp("*.ts")]
 });

 Looking for all the `.json` files in any subfolder:
 walkSync(".", {
   match: [globToRegExp(join("a", "**", "*.json"), {
     extended: true,
     globstar: true
   })]
 });

Parameters

glob: string
optional
unnamed 1: GlobToRegExpOptions = [UNSUPPORTED]

Returns

RegExp