Skip to content

Commit

Permalink
doc: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 3, 2023
1 parent cea1608 commit c47f576
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ export declare function findConfigFile(moduleName: string, root: string, searchP

## loader

Modify default `.js`,`.ts`,`.cjs`,`.mjs` loader parameters.


### iniLoader

Expand All @@ -188,24 +186,7 @@ export declare function loadConf<T>(path: string, option?: LoadConfOption): T;
export declare function jsLoader<T>(filepath: string, content: string, option?: LoadConfOption): T;
```

### jsonLoader

```ts
export declare function jsonLoader<T>(_: string, content: string): T;
```

### tomlLoader

```ts
export declare function tomlLoader<T>(_: string, content: string): T;
```

### yamlLoader

```ts
export declare function yamlLoader<T>(_: string, content: string): T;
```

Modify default `.js`,`.ts`,`.cjs`,`.mjs` loader parameters.

```js
import load, { jsLoader } from 'auto-config-loader';
Expand All @@ -229,7 +210,25 @@ const data = load('namespace', {
});
```

## Yaml loader
### jsonLoader

```ts
export declare function jsonLoader<T>(_: string, content: string): T;
```

### tomlLoader

```ts
export declare function tomlLoader<T>(_: string, content: string): T;
```

### yamlLoader

```ts
export declare function yamlLoader<T>(_: string, content: string): T;
```

## Custom `Yaml` loader

This is an example, the default `yaml`/`yml` does not require a loader.

Expand Down

0 comments on commit c47f576

Please sign in to comment.