src: https://github.com/FormidableLabs/nodejs-dashboard
src: https://github.com/MrRio/vtop
package.json
src: https://github.com/paprikka/lana-cli
{
"name": "cli-chucknorris",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": {
"chucky": "./bin/index.js"
},
"dependencies": {},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
#!/usr/bin/env node
magicGoesHere()
./myServer [-p | --port] <baseDir>
#!/usr/bin/env node
// you can parse arguments by yourself
console.log(process.argv)
const yargs = require('yargs')
const args = yargs
.version()
.help()
.alias('help', 'h')
.command('install <moduleName>')
.option('category')
.default('category', 'dev')
.demandOption(['category'])
.alias('category', 'c')
.example('chucky --category dev')
.epilogue('(c) 2018 the wonderful JSHeroes')
.argv
src: https://github.com/yargs/yargs
src: https://github.com/SBoudrias/Inquirer.js
const inquire = require('inquirer')
return inquire.prompt([
{
type: 'confirm',
name: 'funny',
message: 'was chuck norris funny?'
}
])
src: https://github.com/sindresorhus/ora
src: https://github.com/SamVerschueren/listr
const loader = require('ora')()
loader.start('loading...')
await new Promise(resolve => setTimeout(resolve, 1000))
loader.succeed('ready')
const Listr = require('listr')
const tasks = new Listr([
{
title: 'fetch something1',
task: () => new Promise(resolve => setTimeout(resolve, 1000))
}
])
return tasks.run()
$ docker ps -a
$ docker run mongodb
$ docker logs 5abc1098feca165
$ docker exec -it b7c61vfs64ad1s /bin/bash
src: https://github.com/lirantal/dockly
src: https://github.com/chjj/blessed
const LicenseWatch = require('licensewatch')
const blessed = require('blessed')
const blessedContrib = require('blessed-contrib')
const screen = blessed.screen()
var bar = blessedContrib.bar({
// set widget label
label: 'Licenses in Dependencies',
// center the widget on the screen
top: 'center',
left: 0,
// define vertical bar's layout
barWidth: 4,
barSpacing: 15,
// sets maximum value for bar height otherwise
// it defaults to 1
maxHeight: 100
})
const licenses = new LicenseWatch(
process.cwd() + '/node_modules/**/package.json'
)
licenses.fetch()
licenses.on('licensesSummary', (licenses) => {
const titles = Object.keys(licenses)
const values = Object.values(licenses)
screen.append(bar)
bar.setData({
titles: titles,
data: values
})
screen.render()
})
src: https://github.com/Yomguithereal/react-blessed
import React from 'react';
import blessed from 'blessed';
import { render } from 'react-blessed';
// Creating our screen
const screen = blessed.screen()
// Rendering the React app using our screen
const component = render(<App />, screen);
src: https://github.com/yaronn/blessed-contrib
src: https://github.com/lyonlai/blessed-vue
src: https://github.com/yaronn/blessed-contrib
https://github.com/chjj/blessed https://github.com/yaronn/blessed-contrib https://github.com/Yomguithereal/react-blessed https://github.com/sindresorhus/awesome-nodejs#command-line-utilities https://github.com/k4m4/terminals-are-sexy
@liran_tal github.com/lirantal