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

cli-form

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-form

Build user-friendly command-line forms


Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created

cli-form

Build user-friendly command-line forms easily.

Install

$ npm install cli-form

Usage

var NewForm = require('cli-form')

var form = NewForm('~/.projects', [
  { key: "github", title: "What's your Github handle?", default: process.env.USER, forOnce: true },
  { key: "workspace", title: "Where do you keep your code?", default: process.cwd(), forOnce: true },
  { key: "name", title: "What's your new project name?", expect: { len: [1] } },
  { title: "Starter", desc: "user/repo (Github) or a full Git URL to clone.", default: "bud/react-starter" },
  { title: "Github Repo?", default: "{github}/{name}" }
])

form.prompt(function (answers) {

  answers.github
  // => azer

  answers.starter
  // => bud/go-starter

})

Reference

cli-form is a wrapper for cli-qa module. In addition to what cli-qa's Reference lists;

  • desc
  • forOnce

FAQs

Package last updated on 18 Oct 2015

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