Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clico

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clico

CLI Code Orchestrator - Generate JS source code via CLI with pre-defined code templates

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

CLICO

CLI Code Orchestrator - Generate JS source code via CLI with pre-defined code templates

CLICO is a CLI interface to provide users to generate JS code using snippets. This is useful when there is a need for eliminating boilerplate using standardized code format. The preset templates can be defined to accept variables and the consuming user is prompted to provide values for these variables, the template is then compiled and injected in a file selected by the user.

Installation

npm install -g clico

Usage example

gif

The above example demonstrates the usage with the action.jst template file defined as:

// example/templates/action.jst

module.exports = `export const {{=clico.functionName}} = () => ({
  type: '{{=clico.actionTypeName}}',
  payload: {
    /* Add data here */
  }
});
`

After the user input below is the resulting file:

// generatedFiles/helloWorld.js

export const helloWorld = () => ({
  type: 'HELLO_WORLD_SET',
  payload: {
    /* Add data here */
  }
});

Setup

To setup CLICO for usage in your project, follow the below steps:

  1. CLICO will search for templates in templates folder by default, to define a custom template directory add config as below, in the package.json file
// package.json

"clico": {
  "templateDirectory": "mycustomdirectory"
}
  1. Define template files in your template directory, follow the below as an example:
// example/templates/action.jst

module.exports = `export const {{=clico.functionName}} = () => ({
  type: '{{=clico.actionTypeName}}',
  payload: {
    /* Add data here */
  }
});

In the above example the variables are defined in expressions like {{=clico.myVariableName}}. CLICO parses all the templates and prompts the user to input the values for each of these variables.

  1. Once you have the above setup, simply type clico in your project in the same directory as your package.json file and follow the prompts.

Keywords

FAQs

Package last updated on 19 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc