Skip to content

Commit

Permalink
📖 补充readme文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaubee committed Oct 10, 2024
1 parent 7160ab9 commit e79f8d6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

## [docs 文档](https://jsr.io/@gaubee/util/doc)

**install:**

```bash
npm install @gaubee/util
pnpm install @gaubee/util
yarn install @gaubee/util
deno add npm:@gaubee/util
bun add @gaubee/util

deno add jsr:@gaubee/util
npx jsr add @gaubee/util
yarn dlx jsr add @gaubee/util
pnpm dlx jsr add @gaubee/util
bunx jsr add @gaubee/util
```

**example:**

```ts
import * as gutil from "@gaubee/util";
import { ag_done } from "@gaubee/util/ag";
import { bigint_gcd } from "@gaubee/util/bigint";
import { iter_map_not_null } from "@gaubee/util/collections";
import { date_add_duration } from "@gaubee/util/date";
import { binary_to_hex_string } from "@gaubee/util/encoding";
import { event_target_on } from "@gaubee/util/event_target";
import { func_remember } from "@gaubee/util/func";
import { Lrc } from "@gaubee/util/lrc";
import { map_get_or_put_async } from "@gaubee/util/map";
import { number_gcd } from "@gaubee/util/number";
import { obj_lazify } from "@gaubee/util/object";
import { delay } from "@gaubee/util/promise";
import { rs_with_controller } from "@gaubee/util/readable_stream";
import { SharedFlow } from "@gaubee/util/shared_flow";

const flow = new SharedFlow<string>();
```

### 简介

1. 个人项目经验,涵盖大量常用函数集合,建议与 deno 的 [`@std/*`](https://jsr.io/@std) 互为补充。
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gaubee/util",
"version": "0.9.3",
"version": "0.9.4",
"tasks": {
"build": "deno run -A ./dnt.ts",
"npm": "deno task build && deno task pub-npm",
Expand Down
1 change: 0 additions & 1 deletion src/event_target.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* 这是一些关于 EventTarget 的辅助函数
* @module
*/
type GetEventTargetEventMap<T> = T extends EventTarget
? GetAddEventListenerEventMap<T["addEventListener"]>
Expand Down
1 change: 0 additions & 1 deletion src/lrc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { map_get_or_put, map_get_or_put_async } from "./map.ts";

/**
* @module
* 一个极简的 Least Recently Used 缓存
* @example
* ```ts
Expand Down
1 change: 0 additions & 1 deletion src/shared_flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export type SharedFlowFun<T> = (data: T) => unknown;
export type SharedFlowOff = () => boolean;
export type SharedFlowListenOptions = { key?: unknown; onDispose?: Func };
/**
* @module
* 个极简的事件监听, 支持异步错误捕捉
* 对流有着极好的支持,支持背压,因此你甚至可以把它当作一个流发射器
*
Expand Down

0 comments on commit e79f8d6

Please sign in to comment.