Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dsabre/generate-vue-cli
A Vue CLI to generate components instantly
https://github.com/dsabre/generate-vue-cli
Last synced: about 1 month ago
JSON representation
A Vue CLI to generate components instantly
- Host: GitHub
- URL: https://github.com/dsabre/generate-vue-cli
- Owner: dsabre
- Created: 2023-03-28T11:11:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-08T10:33:28.000Z (over 1 year ago)
- Last Synced: 2023-09-08T11:43:55.571Z (over 1 year ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# generate-vue-cli
A Vue CLI to generate components instantly.
## Run using npx
```bash
npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld
```## Usage
```bash
# Usage: npx @dsabre/generate-vue-cli [flags]# Generate a Vue component.
# Flags:
# --dir (required) The directory where the component will be generated.
# --name (required) The name of the component.
# --prefix (optional) Prefix to prepend to component name.
# --suffix (optional) Suffix to append to component name.
# --template (optional) The template path to use.
#
# -h, --help Display this help message and exit.# Example:
# npx @dsabre/generate-vue-cli --dir="src/components" --name="HelloWorld" --prefix="Prefix" --suffix="Suffix"`);
```## Examples
Create a src/components/HelloWorld.vue component:
```bash
npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld
```### Using templates
You can specify a custom template of your own (use `[[COMPONENT_NAME]]` token to print the new component name, it will be replaced when the component is created):
```vue
// templates/GenericComponent.vueconst msg = '[[COMPONENT_NAME]] component';
{{ msg }}```
then run:
```bash
npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld --template=templates/GenericComponent.vue
```## Authors
- [@dsabre](https://github.com/dsabre)
## License
[MIT](https://choosealicense.com/licenses/mit/)