Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 13, 2023
1 parent 394f566 commit 5e384fa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ pnpm add -D unenv

## Usage

Using `env` utility and built-in presets (and [nodeless](./src/presets/nodeless.ts)), `unenv` will provide an abstract configuration that can be used in building pipelines ([rollup.js](https://rollupjs.org), [webpack](https://webpack.js.org), etc.).
Using `env` utility and built-in presets, `unenv` will provide an abstract configuration that can be used in building pipelines ([rollup.js](https://rollupjs.org), [webpack](https://webpack.js.org), etc.).

```js
import { env, node, deno, nodeless } from "unenv";
import { env } from "unenv";

const { alias, inject, polyfill, external } = env(nodeless, {});
const { alias, inject, polyfill, external } = env({}, {}, {});
```

## Presets
**Note:** You can provide as many presets as you want. unenv will merge them internally and the right most preset has higher periority.

### `node`
### `node` preset

Suitable to convert universal libraries working in Node.js. ([preset](./src/presets/node.ts))

Expand All @@ -40,7 +40,7 @@ import { env, nodeless } from "unenv";
const envConfig = env(node, {});
```

### `nodeless`
### `nodeless` preset

Using this preset, we can convert a code that is depending on Node.js to work anywhere else.

Expand All @@ -50,7 +50,7 @@ import { env, nodeless } from "unenv";
const envConfig = env(nodeless, {});
```

### `deno`
### `deno` preset

This preset can be used to extend `nodeless` to using Deno's Node API Compatibility ([docs](https://docs.deno.com/runtime/manual/node/compatibility) and [docs](https://docs.deno.com/deploy/api/runtime-node)) ([preset](./src/presets/deno.ts)).

Expand Down

0 comments on commit 5e384fa

Please sign in to comment.