npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

daily-sg

v1.0.6

Published

[![NPM version](https://img.shields.io/npm/v/daily-sg.svg)](https://www.npmjs.com/package/daily-sg)

Downloads

67

Readme

daily-sg

NPM version

上古的自动日报命令行工具

  • 获取当月的所有漏填日报(包含今日)自动填写
  • 可自动给内容加日期前缀

安装

npm install -g daily-sg

使用

daily-sg start [日报内容] -u [用户名] -p [密码] -pre [是否给日报内容自动添加日期前缀]

| 参数 | 类型 | 默认值 | 说明 | | ------------- | ------- | ------ | -------------------------------------------------------------------------------------------------- | | -u,--username | string | 无 | 登录的用户名 | | -p,--password | string | 无 | 登录的密码 | | -pre,--prefix | boolean | false | 是否给日报内容自动添加日期前缀 增加前缀后的日报内容为: YYYY-MM-DD 上午(或下午)完成内容:xxxx | | -d,--date | string | 本月 | 指定自动填报月份,格式为 YYYY-MM,默认为当前月份,如 2023-08 |

示例

用户名为 zhangsan,密码为 123456,日报内容为“负责 xxx 项目的日常维护与迭代。”

daily-sg start "负责xxx项目的日常维护与迭代。" -u zhangsan -p 123456 -pre true
⠇ 正在登录中登录成功:zhangsan
⠙ 正在获取项目ID:123
⠸ 正在获取服务器时间:2023-08-28 11:18:04
⠏ 正在获取2023-08的未完成日报数量:
2023-08-28上午
2023-08-28下午
总共2个。(一般一天2个,上午与下午各1个)
✔ 已完成日报: 2个

利用github自动化日报

1、创建工程

github中新建一个工程,创建.github/workflows/ci.yml 文件。yml代码如下:

name: daily-sg

on:
  schedule:
    # 每天下午5点发日报
    - cron: "0 9 * * *" 
  workflow_dispatch:
jobs:
  auto-daily:
    runs-on: ubuntu-latest
    steps:
      # 步骤名获取最新代码
      - name: 🚚 Get latest code
        uses: actions/checkout@v3
      # 安装node环境
      - name: Use Node.js 18
        uses: actions/setup-node@v3
        with:
          node-version: "18.x"
      # 执行命令
      - name: Run shell
        run: npx daily-sg start "这里为日报内容" -u ${{ secrets.USER }} -p ${{ secrets.PWD }} -pre true

然后提交代码并推送到你的仓库

2、配置环境变量

可以留意到yml脚本命令中含有环境变量secrets.USERsecrets.PWD,为了安全起见,github提供了环境变量功能,操作方法如下:

1、进入该项目的settings,选择"Security"-"Actions secrets and variables"-"Action"

2、进入"Action"页面后,在"Repository secrets"项下创建你登录账号"USER"变量与密码"PWD"变量。

如果你不想使用变量,也可以直接将上述yml代码中的${{ secrets.USER }}${{ secrets.PWD }} 部分替换为具体值。

3、测试

一般进行到第2步后,actions就已经生效了,脚本将会每天下午5点执行。但如果你想手动执行试试,则可按如下操作:
在该工程下进入"Actions"页面,在左侧选择"daily-sg",在右侧找到"Run workflow"按钮,选择分支后手动刷新页面等待结果,可点击进入查看执行日志。