Skip to content

Commit b2da5d1

Browse files
committed
docs: update usage docs
1 parent 83d09f6 commit b2da5d1

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

README.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
![](./japa_art.png)
77

8-
The `create-japa` is a small CLI utility to configure Japa inside an existing Node.js project.
8+
The `create-japa` is a CLI utility configuring Japa inside a new or existing Node.js project.
99

1010
The process involves installing the required packages and creating the necessary files. The setup works with Typescript and JavaScript projects.
1111

@@ -25,25 +25,47 @@ pnpm create japa
2525

2626
## Options
2727

28-
### `destination`
28+
### `destination (optional)`
2929

30-
You can pass the destination directory as the first argument to the command. For example:
30+
You can pass the destination directory as the first argument to the command. The `process.cwd()` will be used when the option is not defined.
3131

3232
```sh
3333
npm init japa my-app
3434
```
3535

36-
This will initialize Japa inside the `my-app` directory.
37-
3836
### `--package-manager`
3937

40-
We are trying to detect the package manager used by your project. However, you can always override it by passing the `--package-manager` flag.
38+
Define the package manager to use to install dependencies. If not defined, we will attempt to detect the package manager using [@antfu/install-pkg
39+
](https://github.com/antfu/install-pkg) package.
4140

4241
```sh
4342
npm init japa -- --package-manager=pnpm
4443
```
4544

46-
Follow the prompts and you will be all set!
45+
### `--plugins`
46+
Define an array of plugins to install. We will display a series of prompts if this flag is not set.
47+
48+
```sh
49+
npm init japa -- --plugins="@japa/api-client" --plugins="@japa/snapshot"
50+
```
51+
52+
### `--project-type`
53+
Define the project type for which you want to configure Japa. The value could be either `typescript` or `javascript`. If this flag is not set, we will display a prompt for the project type selection.
54+
55+
```sh
56+
npm init japa -- --project-type=typescript
57+
```
58+
59+
### `--sample-test-file`
60+
Enable the flag to create a sample test file or disable it not to create it.
61+
62+
```sh
63+
# Enable it
64+
npm init japa -- --sample-test-file
65+
66+
# Disable it
67+
npm init japa -- --no-sample-test-file
68+
```
4769

4870
[github-actions-image]: https://img.shields.io/github/actions/workflow/status/japa/create-japa/checks.yml?style=for-the-badge
4971
[github-actions-url]: https://github.com/japa/create-japa/actions/workflows/checks.yml "github-actions"

0 commit comments

Comments
 (0)