2019-10-16 14:39:33 -04:00
|
|
|
# Deno Path Manipulation Libraries
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
```ts
|
2020-10-04 08:18:36 -04:00
|
|
|
import * as path from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
2019-10-16 14:39:33 -04:00
|
|
|
```
|
2020-05-17 13:24:39 -04:00
|
|
|
|
|
|
|
### globToRegExp
|
|
|
|
|
|
|
|
Generate a regex based on glob pattern and options This was meant to be using
|
|
|
|
the the `fs.walk` function but can be used anywhere else.
|
|
|
|
|
|
|
|
```ts
|
2020-10-04 08:18:36 -04:00
|
|
|
import { globToRegExp } from "https://deno.land/std@$STD_VERSION/path/glob.ts";
|
2020-05-17 13:24:39 -04:00
|
|
|
|
|
|
|
globToRegExp("foo/**/*.json", {
|
|
|
|
flags: "g",
|
|
|
|
extended: true,
|
|
|
|
globstar: true,
|
2020-10-03 16:19:11 -04:00
|
|
|
}); // returns the regex to find all .json files in the folder foo.
|
2020-05-17 13:24:39 -04:00
|
|
|
```
|