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