This commit is contained in:
parent
5aeff6518e
commit
c0ebebb9fd
22
readme.md
22
readme.md
|
@ -64,6 +64,28 @@ pickit ./config.ts
|
||||||
Most methods are exported from `mod.ts` and can be used within your code. Read
|
Most methods are exported from `mod.ts` and can be used within your code. Read
|
||||||
the [API documentation](https://deno.land/x/pickit/mod.ts)
|
the [API documentation](https://deno.land/x/pickit/mod.ts)
|
||||||
|
|
||||||
|
> All functions are using RegExp to match files. So you need to convert globs
|
||||||
|
> explicitly. Example:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { githubPick } from "https://deno.land/x/pickit@v0.0.3/mod.ts";
|
||||||
|
import { globToRegExp, join } from "$std/path/mod.ts";
|
||||||
|
import { readAll } from "$std/streams/conversion.ts";
|
||||||
|
|
||||||
|
for await (
|
||||||
|
const cssFile of githubPick({
|
||||||
|
repo: "saadeghi/daisyui",
|
||||||
|
version: "v2.47.0",
|
||||||
|
pick: [
|
||||||
|
globToRegExp("**/src/components/**/*.css"),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
const css = new TextDecoder("utf-8").decode(await readAll(cssFile));
|
||||||
|
// do something with css
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
Loading…
Reference in a new issue