项目作者: ChalkPE

项目描述 :
Welcome message for shells
高级语言: JavaScript
项目地址: git://github.com/ChalkPE/welcomes.git
创建时间: 2017-04-30T02:02:57Z
项目社区:https://github.com/ChalkPE/welcomes

开源协议:MIT License

下载


welcomes CircleCI npm version npm downloads JavaScript Style Guide

Welcome message for shells

Main screenshot

Installation

  1. $ 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

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

time plugin

Key Description Default
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

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

hangang plugin

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

Via CLI argument

  1. $ welcomes time dimibob hangang \
  2. --dev --verbose --timeout 5000 \
  3. \
  4. --time:locale ko --time:format LLLL \
  5. --time:color yellow --time:fgColor magenta --time:style underline \
  6. \
  7. --dimibob:ignoreSnack \
  8. --dimibob:cmd bob --dimibob:cmdFormat L \
  9. --dimibob:paramFormat YYYYMMDD \
  10. --dimibob:server "http://dimigo.in/pages/dimibob_getdata.php" \
  11. --dimibob:likes ./favorites.txt --dimibob:likesColor yellow_underline_bold \
  12. \
  13. --hangang:icon='★' \
  14. --hangang:server "http://hangang.dkserver.wo.tc" \
  15. --hangang:style underline --hangang:fgColor red_bold

Via config file

  1. $ cat welcomes.json
  2. {
  3. "_": [
  4. "time",
  5. "dimibob",
  6. "hangang"
  7. ],
  8. "dev": true,
  9. "verbose": true,
  10. "timeout": 5000,
  11. "time": {
  12. "color": "yellow",
  13. "fgColor": "magenta",
  14. "style": "underline",
  15. "locale": "ko",
  16. "format": "LLLL"
  17. },
  18. "dimibob": {
  19. "cmd": "bob",
  20. "cmdFormat": "L",
  21. "onlyToday": false,
  22. "ignoreSnack": true,
  23. "likes": "./favorites.txt",
  24. "likesColor": "yellow_underline_bold",
  25. "paramFormat": "YYYYMMDD",
  26. "server": "http://dimigo.in/pages/dimibob_getdata.php"
  27. },
  28. "hangang": {
  29. "icon": "★",
  30. "style": "underline",
  31. "fgColor": "red_bold",
  32. "server": "http://hangang.dkserver.wo.tc"
  33. }
  34. }
  35. $ welcomes --config welcomes.json

Output

Usage screenshot

License

MIT License