Skip to content

Commit 12b6225

Browse files
authored
docs: clarify CLI usage (#1534)
1 parent 9a030b7 commit 12b6225

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,26 @@ via [Homebrew](https://brew.sh/).
7272

7373
## Usage
7474

75+
### Via JavaScript
76+
7577
JavaScript API usage can be found in the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html).
7678

77-
### From the Command Line
79+
### From the command line
7880

7981
Running Electron Packager from the command line has this basic form:
8082

8183
```
8284
npx electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]
8385
```
8486

85-
**Note**: `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and
86-
the version you have installed.
87+
> **Note**:
88+
> `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and
89+
> the version you have installed.
8790
8891
This will:
8992

90-
- Find or download the correct release of Electron
91-
- Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>` *(this can be customized via an optional flag)*
93+
* Find or download the correct release of Electron
94+
* Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>` *(this can be customized via an optional flag)*
9295

9396
`--platform` and `--arch` can be omitted, in two cases:
9497

@@ -100,6 +103,13 @@ For an overview of the other optional flags, run `electron-packager --help` or s
100103
[usage.txt](https://github.com/electron/electron-packager/blob/main/usage.txt). For
101104
detailed descriptions, see the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html).
102105

106+
For flags that are structured as objects, you can pass each option as via dot notation as such:
107+
108+
```sh
109+
npx electron-packager --flag.foo="bar"
110+
# will pass in { flag: { foo: "bar"} } as an option to the Electron Packager API
111+
```
112+
103113
If `appname` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json.
104114

105115
**Characters in the Electron app name which are not allowed in all target platforms' filenames

0 commit comments

Comments
 (0)