@@ -72,23 +72,26 @@ via [Homebrew](https://brew.sh/).
72
72
73
73
## Usage
74
74
75
+ ### Via JavaScript
76
+
75
77
JavaScript API usage can be found in the [ API documentation] ( https://electron.github.io/electron-packager/main/modules/electronpackager.html ) .
76
78
77
- ### From the Command Line
79
+ ### From the command line
78
80
79
81
Running Electron Packager from the command line has this basic form:
80
82
81
83
```
82
84
npx electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]
83
85
```
84
86
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.
87
90
88
91
This will:
89
92
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)*
92
95
93
96
` --platform ` and ` --arch ` can be omitted, in two cases:
94
97
@@ -100,6 +103,13 @@ For an overview of the other optional flags, run `electron-packager --help` or s
100
103
[ usage.txt] ( https://github.com/electron/electron-packager/blob/main/usage.txt ) . For
101
104
detailed descriptions, see the [ API documentation] ( https://electron.github.io/electron-packager/main/modules/electronpackager.html ) .
102
105
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
+
103
113
If ` appname ` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json.
104
114
105
115
** Characters in the Electron app name which are not allowed in all target platforms' filenames
0 commit comments