1.0.2 • Published 7 years ago

welcomes v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

welcomes CircleCI npm version npm downloads JavaScript Style Guide

Welcome message for shells

Main screenshot

Installation

$ npm install -g welcomes

Usage

Add welcomes --config config.json or welcomes time hangang custom-a custom-b --configs to your run commands file (.bashrc, .bash_profile or .zshrc etc.)

  • Pre-installed plugins: time, hangang, dimibob
  • custom-a is short for welcomes-plugin-custom-a npm package

Configuration

Basic

KeyDescriptionDefault
dev -> booleanfalse일 경우 에러 메세지가 출력되지 않습니다.false
verbose -> booleantrue일 경우 현재 설정이 출력됩니다.false
timeout -> number요청 타임아웃, 밀리초 단위 (axios 문서 참고)0
encoding -> string인코딩 (axios 문서 참고)'utf-8'

time plugin

KeyDescriptionDefault
locale -> string출력할 시간의 로케일 (moment 문서 참고)null
format -> string출력할 시간의 날짜 포맷 (moment 문서 참고)'HH:mm:ss'
style -> string출력할 텍스트의 스타일 (chalk 문서 참고)null
color -> string출력할 텍스트의 배경색, bg 제외. (chalk 문서 참고)'white'
fgColor -> string출력할 텍스트의 전경색 (chalk 문서 참고)'black'

dimibob plugin

KeyDescriptionDefault
ignoreSnack -> booleantrue일 경우 21시 40분 이전에도 간식 대신 다음 아침 메뉴를 출력합니다.false
onlyToday -> booleantrue일 경우 21시 40분부터 자정까지는 아무 것도 출력하지 않습니다. false일 경우 21시 40분부터 익일 8시 45분까지 다음 아침 메뉴를 출력합니다.false
cmd -> string출력할 명령어 이름'dimibob'
cmdFormat -> string출력할 명령어 인자의 날짜 포맷 (moment 문서 참고)'dimibob'
likes -> string좋아하는 급식 리스트 (예시) 파일의 경로 null이 아닐 경우 해당되는 메뉴의 텍스트가 강조됨.null
likesColor -> stringlikesnull이 아닐 경우에만 필요 좋아하는 메뉴 텍스트의 강조 스타일 (chalk 문서 참고).'blue'
server -> string디미고 급식 API의 주소. URL 파리미터 d로 날짜를 지정할 수 있어야 함.여기
paramFormat -> stringURL 파리미터 d의 날짜 포맷 (moment 문서 참고)'YYYYMMDD'

hangang plugin

KeyDescriptionDefault
icon -> string온도 좌측에 표시될 이모지'🌡'
style -> string출력할 텍스트의 스타일 (chalk 문서 참고)null
fgColor -> string출력할 텍스트의 전경색 (chalk 문서 참고)'black'
server -> string한강 온도 API의 주소. JSON으로 응답해야 하며, temp 필드가 현재 온도 값이어야 함.여기

Via CLI argument

$ welcomes time dimibob hangang \
  --dev --verbose --timeout 5000 \
  \
  --time:locale ko --time:format LLLL \
  --time:color yellow --time:fgColor magenta --time:style underline \
  \
  --dimibob:ignoreSnack \
  --dimibob:cmd bob --dimibob:cmdFormat L \
  --dimibob:paramFormat YYYYMMDD \
  --dimibob:server "http://dimigo.in/pages/dimibob_getdata.php" \
  --dimibob:likes ./favorites.txt --dimibob:likesColor yellow_underline_bold \
  \
  --hangang:icon='★' \
  --hangang:server "http://hangang.dkserver.wo.tc" \
  --hangang:style underline --hangang:fgColor red_bold

Via config file

$ cat welcomes.json
{
  "_": [
    "time",
    "dimibob",
    "hangang"
  ],

  "dev": true,
  "verbose": true,
  "timeout": 5000,

  "time": {
    "color": "yellow",
    "fgColor": "magenta",
    "style": "underline",

    "locale": "ko",
    "format": "LLLL"
  },

  "dimibob": {
    "cmd": "bob",
    "cmdFormat": "L",

    "onlyToday": false,
    "ignoreSnack": true,

    "likes": "./favorites.txt",
    "likesColor": "yellow_underline_bold",

    "paramFormat": "YYYYMMDD",
    "server": "http://dimigo.in/pages/dimibob_getdata.php"
  },

  "hangang": {
    "icon": "★",
    "style": "underline",
    "fgColor": "red_bold",

    "server": "http://hangang.dkserver.wo.tc"
  }
}

$ welcomes --config welcomes.json

Output

Usage screenshot

License

MIT License