1.0.14 • Published 5 years ago

happycode-gears-terminal v1.0.14

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Terminal

Terminal (for Gears) is a minimal event subscriber / emitter

Installation

npm install happycode-gears-terminal

Usage

import {
    info,
    warn,
    log,
    success,
    error,
    welcomeBanner,
    checkbox,
    indent,
    tempLine,
    clearLine,
    emojify,
    keyValue,
    chalk
} from 'happycode-gears-terminal'

or

const {
    info,
    warn,
    log,
    success,
    error,
    welcomeBanner,
    checkbox,
    indent,
    tempLine,
    clearLine,
    emojify,
    keyValue,
    chalk
} = require('happycode-gears-terminal')
welcomeBanner("Terminal", true)
info('This is an "info" line')
warn('This is an "warn" line')
success('This is an "success" line')
error('This is an "error" line')
keyValue('Key', '...and a value')


info(emojify("I :heart:  NY!"))

indent(() => checkbox('No way!', false), 4)
indent(() => checkbox('Yes way dude!', true), 8)
indent(() => checkbox('you\'re on Fire dude!', ':fire: '), 4)
log(':fire:')

const tempCheckbox = (message, emojiName) => `${chalk.bold.yellow(`[${emojify(`:${emojiName}:`)}]`)} ${chalk.bold.green(message)}`
tempLine(tempCheckbox('just for a bit', 'strawberry'))
setTimeout(() => {
    tempLine(tempCheckbox('just for a while', 'cherries'))
    setTimeout(() => {
        tempLine(tempCheckbox('not long now', 'hamburger'))
        setTimeout(() => {
            tempLine(tempCheckbox('nearly there', 'doughnut'))
            setTimeout(() => {
                tempLine(tempCheckbox('TA DAH!!!', 'lollipop'))
                setTimeout(() => {
                    clearLine()
                }, 500)
            }, 1000)
        }, 1000)
    }, 1000)
}, 1000)

// uncomment to clear after 7s
//
// setTimeout(clear, 7000)

License

MIT

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago