The create
command is responsible for setting up a new browser extension project using Extension.js.
This command accepts flags like --template
for initializing your extension with various templates,
and allows you to define the directory or path where the extension will be created.
The command is designed to simplify the setup process for developers,
providing a streamlined way to get started with cross-browser extension development.
Given a folder or template URL, the create
command initializes a new extension project in the specified directory applying the chosen template and relevant metadata to the project.
You can run the create
command using the following syntax.
Replace <extension-name|extension-path>
with your project name or path and set any required options:
Example Usage with Templates
This example demonstrates creating a new extension using the react
template.
You can substitute react
with any available template from the Templates section.
The create
command can also accept a specific directory where you want to create the extension.
If no path is provided, it defaults to the current working directory.
In this example, the extension is created in the path/to/my-extension
directory.
The create
command accepts several arguments and flags to customize the behavior of the extension creation:
Flag | Argument | What it does | Defaults to |
---|---|---|---|
[path or name] |
The extension path or name | If a path is defined, loads the local extension. If a name is provided, loads the extension in the current working directory. | process.cwd() |
-t, --template | Name of the template used to bootstrap your extension | Bootstrap your extension using a template | new |
--install | Whether or not to auto install the template dependencies | Install dependencies and devDependencies during creation time | true |
--template
: Specifies the template to use when bootstrapping the extension (e.g., react
, typescript
).This command creates a new extension named my-new-extension using the React template.
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
An Extension.js template
npx extension dev --browser=init
extension.config.js
file to configure your extension.