From 57d199b7c082e9788b9fd73e5d7e5a3d8d0e273f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 26 Nov 2021 17:24:37 +0800 Subject: [PATCH] init --- .gitignore | 17 +++++++++++++++++ .prettierrc.yaml | 9 +++++++++ Readme.md | 27 +++++++++++++++++++++++++++ index.js | 17 +++++++++++++++++ package.json | 18 ++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 .gitignore create mode 100644 .prettierrc.yaml create mode 100644 Readme.md create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce19c5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +.DS_Store +.AppleDouble +.LSOverride +.vscode +.idea + +node_modules/ +package-lock.json + + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..d637788 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,9 @@ +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 100 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..0d9b9ba --- /dev/null +++ b/Readme.md @@ -0,0 +1,27 @@ +``` + ____ _ _ + / ___|__ _| | ___ _ __ __| | __ _ _ __ +| | / _` | |/ _ \ '_ \ / _` |/ _` | '__| +| |__| (_| | | __/ | | | (_| | (_| | | + \____\__,_|_|\___|_| |_|\__,_|\__,_|_| 终端版万年历 + +``` + + +## 安装 +```bash +npm i -g bash-calendar +``` + +## 用法 +> 用法: `cal [command] args...` + ++ Commands: + * -h - 查看帮助文档 + * -v - 查看工具的版本 + + +## 更新日志 + +### v0.0.1 +* 初始化项目 diff --git a/index.js b/index.js new file mode 100644 index 0000000..acfd639 --- /dev/null +++ b/index.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +/** + * {终端版万年历} + * @author yutent + * @date 2021/11/26 17:20:02 + */ + +function print(...args) { + args[0] = args[0].padEnd(20, ' ') + if (args.length > 1) { + args.splice(1, 0, ' - ') + } + console.log.apply(null, args) +} + +print('Hello calendar!') diff --git a/package.json b/package.json new file mode 100644 index 0000000..1febf93 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "bash-calendar", + "description": "终端版万年历", + "version": "0.0.1", + "author": "yutent ", + "bin": { + "calendar": "index.js", + "cal": "index.js" + }, + "dependencies": { + "chalk": "^4.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/yutent/bash-calendar.git" + }, + "license": "MIT" +}