Skip to content

Commit

Permalink
Support the dlx command
Browse files Browse the repository at this point in the history
From the discussion in #11

I've mirrored the implementation of the `exec` command.

Note: for pnpm, whilst there is an alias — `pnpx` — I've chosen to use `pnpm dlx`, as the alias was only introduced in pnpm v9 (Apr 2024).
  • Loading branch information
jits committed Oct 31, 2024
1 parent 2c96f3e commit 9ea2863
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PackageManagers from '../../components/PackageManagers.astro'
## Features

- Support for various package managers: [npm](https://www.npmjs.com), [yarn](https://yarnpkg.com), [pnpm](https://pnpm.io), [bun](https://bun.sh) & [ni](https://github.com/antfu/ni).
- Support for various types of command: [`add`](/usage/#add), [`create`](/usage/#create), [`exec`](/usage/#exec), [`run`](/usage/#run) & [`remove`](/usage/#remove).
- Support for various types of command: [`add`](/usage/#add), [`create`](/usage/#create), [`dlx`](/usage/#dlx), [`exec`](/usage/#exec), [`run`](/usage/#run) & [`remove`](/usage/#remove).
- Synced tabs between each instance on the same page.
- Customizable output with [extra arguments](/usage/#extra-arguments), [comments](/usage/#comment) & [prefixes](/usage/#prefix).

Expand Down
12 changes: 12 additions & 0 deletions docs/src/content/docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ The code above generates the following commands:

<PackageManagers type="create" pkg="astro@latest" />

### `dlx`

To fetch and download a package binary, without installing it as a dependency, you can use the `dlx` type and specify extra arguments using the `args` prop.

```mdx title="src/content/docs/example.mdx" 'type="dlx"'
<PackageManagers type="dlx" pkg="serve" args="public" />
```

The code above generates the following commands:

<PackageManagers type="dlx" pkg="serve" args="public" />

### `exec`

To execute a package binary, you can use the `exec` type and specify extra arguments using the `args` prop.
Expand Down

0 comments on commit 9ea2863

Please sign in to comment.