Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Feb 9, 2025
1 parent b18c601 commit 7d8ecea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
npm i unloader
```

## Usage

See [example](./playground/demo.ts) for more details.

## Credits

- Thanks to [tsx](https://github.com/privatenumber/tsx)!

## Sponsors

<p align="center">
Expand Down
17 changes: 9 additions & 8 deletions playground/demo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// @ts-check

import type { Plugin, PluginContext, PluginEntry } from '../dist/index.d.ts'

export function demoPlugin(): PluginEntry<Data> {
return {
name: 'demo',
entry: import.meta.url,
data: { count: 10 },
}
}

export interface Data {
count: number
}
Expand All @@ -26,13 +35,5 @@ const plugin: Plugin<Data> = {
},
}

export function demoPlugin(): PluginEntry<Data> {
return {
name: 'demo',
entry: import.meta.url,
data: { count: 10 },
}
}

// eslint-disable-next-line import/no-default-export
export default plugin

0 comments on commit 7d8ecea

Please sign in to comment.