Socket
Socket
Sign inDemoInstall

@emvicify/cli

Package Overview
Dependencies
59
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @emvicify/cli

CLI for Emvicify Framework


Version published
Maintainers
1
Install size
7.68 MB
Created

Readme

Source

Emvicify CLI

Scaffolding tool for Emvicify

NPM Version Build Status

Wiki

Installation

You can install the package from npm.

npm i -g @emvicify/cli

Usage

For the complete command list, please go to the Wiki - CLI Command List page

mfy --help
emvicify --help

Getting started

  1. Run the command in your NPM Project folder
mfy here
  1. Follow the wizard
  2. (Optional) Power emvicify with its plugins

Happy coding ;)

CLI Commands Examples

For the complete command list, please go to the Wiki - CLI Command List page

Add a new controller - it'll create an UsersController class

mfy add:controller Users

or

mfy ac Users

Add a new router - it'll create an AuthRouter class

mfy add:router Auth

or

mfy ar Auth

Add a new service - it'll create an UsersManagementService class

mfy add:service UsersManagement

or

mfy as UsersManagement

Add a new empty middleware - it'll create an AuthMiddleware class

mfy add:middleware Auth

or

mfy am Auth

Add a new Basic Authentication middleware (overriding all virtual methods for you to use it)

mfy am --authentication basic --with-overrides Auth

FAQ

How can I add an express plugin?

You can add a function called "configureAppBeforeServe" with your custom implementation.

Complete example

const { start } = require("emvicify");
const settingsFile = require("./settings.json");
const expressSettings = {
    bodyParserJson: true,
    bodyParserUrlencoded: true,
    bodyParserRaw: false
};

function configureAppBeforeServe(app, http) {
    //  Extra express plugin
    const cors = require("cors");
    app.use(cors());
}

start(process.cwd(), settingsFile.port, { settingsFile, expressSettings, configureAppBeforeServe }).then(() => {
    console.log(`Listening on port ${settingsFile.port}`);
}, err => {
    console.error("Application failed", err);
});

Keywords

FAQs

Last updated on 06 Dec 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc