Create your own command line

This post will show you how to create a command-line npm module (CLI) using Commander.js module.

Commander.js is a very popular module that lets you create your own CLI program.

First, start your new project — let’s say my project name is “json-now”

$ git clone https://github.com/yourname/json-now.git
$ cd json-now

A simple way to work with Forms in React. This is my attempt to address complicate form rendering:

<FormContainer onSubmit={this.onSubmit} render={props => (
<Form use="bootstrap4">
<Field label="Text" name="text" />
<Field name="password" />
<Field textarea name="textarea" />
<Field select options={animals} name="select" />
<Field radios options={genders} name="radio" />
<Field checkboxes options={roles} name="checkboxes" />
<Field number name="number" />
<Field date name="date" />
<Field time name="time" />
<Field toggle inline name="toggle" />
<Field file label="File Upload" name="file1" />
<Field file withPreview label="File Upload (with Preview)" name="file2" />
<Field range name="range" />

<Button type="submit"/>
<Button>Cancel</Button>
</Form>
)} />

Result: (Full form, validation (with yup) & error messages)

Demo
Github

I appreciate any feedbacks, suggestions or ideas below. Thanks! :)

One of the key metrics when writing code is speed. But there is no convenient way to measure the speed of your code efficiently so far. Chrome and other browsers do have APIs (new Date(), performance.now(), console.time) …

Duc N.

Full-stack Web/Mobile JS Dev.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store