Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
This is command line interface for owc mvc framework to generate project, modules, controllers, models and so on.
owc is a lightweight mvc framework for building aws lambda web services based on express.
Prerequisites:
You must be familiar with aws-sdk and have knowledge about various aws services.
This lambda web service is deployed with sam command. You need to understand yaml file formats in order to deploy to aws.
Release Notes
2.0.10 - Changed elasticsearch model template to comply with package owc-elasticsearch
2.0.9 - Added ability to create dynamodb models
Installation
Just run below command to install this command line interface globally
sudo npm i -g owc-cli
Usage
1. Command Overview:
owc-cli -t <type> -n <name> [options]
options includes:
-d --dest This is used to specify the destination where you want to create project
-r --root This is used to provide the root dir of your project when you create modules, models, etc.
-s --schema This is to specify the schema/database your table is in when creating models
-b --database The name of the database connection you define in config.json file
-p --parent This is used to define the parent class of the model you want to create
-l --table The table you want to create model for
-a --all This is to tell the command whether you want to create models for all the tables in a given schema when you create model class for the schema
-f --prefix prefix for the tables, for example all tables start with prefix "tbl_"
-e --elasticsearch the name of the elasticsearch service in config.json file
-m --module the name of the module under which the controller will be created
2. Create a new project
Below command will create a new project "owc-project":
owc-cli -t project -n owc-project -d /home/ubuntu/
3. Create a new module
owc-cli -t module -n user -r /home/ubuntu/owc-project
4. Create a new model class for schema
Please be reminded that the names are case sensitive
owc-cli -r /home/ubuntu/owc-project -t schema -n User -s user -b db -a true -f tbl_ -e elasticsearch
If you have "-a true", models will be created for all the tables in schema "user".
If you have "-e elasticsearch", elasticsearch models will be created for all tables as well.
5. Create a new model class for table
owc-cli -r /home/ubuntu/owc-project -t model -n Tenant -s user -b db -p User -l tbl_tenant -e elasticsearch
6. Create a controller under a given module
owc-cli.js -t controller -m user -n profile -r /home/ubuntu/owc-project
This will create ProfileController under module user
7. Create a controller outside modules
owc-cli.js -t controller -n profile -r /home/ubuntu/owc-project
8. Create a dynamodb model
owc-cli -t dynamodb -n User -r /home/ubuntu/owc-project -l tbl_user
FAQs
owc cli to generate project and files
The npm package owc-cli receives a total of 1 weekly downloads. As such, owc-cli popularity was classified as not popular.
We found that owc-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.