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 🙏

© 2025 – Pkg Stats / Ryan Hefner

koishi-plugin-image-save-path

v1.6.0

Published

[<ruby>保存图片<rp>(</rp><rt>点我查看食用方法</rt><rp>)</rp></ruby>](https://www.npmjs.com/package/koishi-plugin-image-save-path) 💾支持[交互保存图片](https://i0.hdslb.com/bfs/article/a2780975ccbf74c422dd7f0333af0172312276085.png) 、 [回复保存图片](https://i0.hdslb.com/bfs/article/

Readme

图片保存配置项

1. 图片扩展名配置 (ImageExtension)

功能描述

ImageExtension 是一个用于定义图片保存时文件名前缀、后缀和默认扩展名的配置项。支持动态替换日期、随机数字以及 sessionconfig 中的字段。

配置项格式

  • 类型:数组(仅第一行视为有效配置)

  • 默认值

    [
      {
        prefix: "",
        suffix: "",
        extension: ".png"
      }
    ]
  • 示例

    ImageExtension: [
      {
        prefix: "prefix_${YYYY}_",
        suffix: "_${session.userId}",
        extension: ".jpg"
      }
    ]

可用占位符

| 占位符 | 描述 | | ------------ | -------------------------------------------------------------------- | | ${YYYY} | 当前年份,例如 2023 | | ${MM} | 当前月份,补零到两位,例如 0112 | | ${DD} | 当前日期,补零到两位,例如 0131 | | ${A} | 一位随机数字,范围 09 | | ${BB} | 两位随机数字,范围 0099 | | ${CCC} | 三位随机数字,范围 000999 | | ${session} | 动态提取 session 对象的字段,例如 ${session.userId} | | ${config} | 动态提取 config 对象的字段,例如 ${config.defaultImageExtension} |

示例

  • 默认格式

    ImageExtension: [
      {
        prefix: "",
        suffix: "",
        extension: ".png"
      }
    ]
    • 生成文件名:2023-10-05-12-34-56-789.png
  • 包含前缀和后缀

    ImageExtension: [
      {
        prefix: "prefix_${YYYY}_",
        suffix: "_${session.userId}",
        extension: ".jpg"
      }
    ]
    • 生成文件名(假设 session.userId12345):prefix_2023_2023-10-05-12-34-56-789_12345.jpg
  • 包含配置项

    ImageExtension: [
      {
        prefix: "prefix_${config.ImageExtension[0]?.extension}_",
        suffix: "_${CCC}",
        extension: ".png"
      }
    ]
    • 生成文件名(假设 config.defaultImageExtensionpng):prefix_png_2023-10-05-12-34-56-789_123.png

2. 图片自动重命名规则 (autoRenameRules)

功能描述

autoRenameRules 是一个用于定义图片自动重命名规则的配置项。通过设置占位符,用户可以自定义生成的文件名格式。支持动态替换日期、随机数字以及 sessionconfig 中的字段。

配置项格式

  • 类型:字符串

  • 默认值${YYYY}-${MM}-${DD}-${BB}-${BB}-${BB}-${CCC}

  • 示例

    autoRenameRules: "${YYYY}-${MM}-${DD}-${BB}-${BB}-${BB}-${CCC}-${session.userId}"

可用占位符

| 占位符 | 描述 | | ------------ | -------------------------------------------------------------------- | | ${YYYY} | 当前年份,例如 2023 | | ${MM} | 当前月份,补零到两位,例如 0112 | | ${DD} | 当前日期,补零到两位,例如 0131 | | ${A} | 一位随机数字,范围 09 | | ${BB} | 两位随机数字,范围 0099 | | ${CCC} | 三位随机数字,范围 000999 | | ${session} | 动态提取 session 对象的字段,例如 ${session.userId} | | ${config} | 动态提取 config 对象的字段,例如 ${config.defaultImageExtension} |

示例

  • 默认格式

    autoRenameRules: "${YYYY}-${MM}-${DD}-${BB}-${BB}-${BB}-${CCC}"
    • 生成文件名:2023-10-05-12-34-56-789.png
  • 包含用户 ID

    autoRenameRules: "${YYYY}-${MM}-${DD}-${BB}-${BB}-${BB}-${CCC}-${session.userId}"
    • 生成文件名(假设 session.userId12345):2023-10-05-12-34-56-789-12345.png
  • 包含配置项

    autoRenameRules: "${YYYY}-${MM}-${DD}-${BB}-${BB}-${BB}-${CCC}-${config.defaultImageExtension}"
    • 生成文件名(假设 config.defaultImageExtensionpng):2023-10-05-12-34-56-789-png.png