Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ionic-team/create-capacitor-plugin
Create a new Capacitor plugin ⚡️
https://github.com/ionic-team/create-capacitor-plugin
android capacitor cross-platform ios java javascript pwa swift
Last synced: 2 months ago
JSON representation
Create a new Capacitor plugin ⚡️
- Host: GitHub
- URL: https://github.com/ionic-team/create-capacitor-plugin
- Owner: ionic-team
- License: other
- Created: 2020-08-21T22:27:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T10:59:07.000Z (3 months ago)
- Last Synced: 2024-10-01T05:41:54.490Z (2 months ago)
- Topics: android, capacitor, cross-platform, ios, java, javascript, pwa, swift
- Language: TypeScript
- Homepage:
- Size: 503 KB
- Stars: 77
- Watchers: 11
- Forks: 11
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-capacitorjs - @capacitor/plugin - Create a new Capacitor plugin. (Tools / Community Plugins)
- awesome-capacitor - Plugin generator - Create a new Capacitor plugin. (Tools / Incompatible)
README
# Create Capacitor Plugin
Generate a new Capacitor plugin.
## Usage
```
npm init @capacitor/plugin [] [options]
```:memo: `npm init ` requires npm 6+
You can also try the following methods to use this package:
- `npx @capacitor/create-plugin`
- `yarn create @capacitor/plugin`
- `npm install -g @capacitor/create-plugin && create-capacitor-plugin`### Example Apps
As of the `0.8.0` release, example apps for testing are included when initializing a new plugin. To use these templates, you can open the `npx cap open android` or `npx cap open ios` command for Android and iOS respectively. Anything in the `example-app` folder will be excluded when publishing to npm.
### Options
```
--name ............. npm package name (e.g. "capacitor-plugin-example")
--package-id ......... Unique plugin ID in reverse-DNS notation (e.g. "com.mycompany.plugins.example")
--class-name ....... Plugin class name (e.g. "Example")
--repo .............. URL to git repository (e.g. "https://github.com/example/repo")
--author ......... Author name and email (e.g. "Name ")
--license ............ SPDX License ID (e.g. "MIT")
--description ...... Short description of plugin features
```