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

picgo-plugin-filename-format

v0.1.2

Published

A picgo plugin to format filename by your setting.

Downloads

48

Readme

picgo-plugin-filename-format

A picgo plugin to format filename by your setting.

Installation

# Mac
cd ~/.picgo && npm i --save picgo-plugin-filename-format
# Windows
cd C:\\Users\\<Your User Name>\\.picgo && npm i --save picgo-plugin-filename-format

Usage

After install this plugin, you should edit .picgo/config.json like this

{
  "picBed": {
    "uploader": "aliyun",
    "aliyun": {
      // ...
    },
    "current": "aliyun"
  },
  "picgoPlugins": {
    // use this plugin
    "picgo-plugin-filename-format": true
  },
  // config how to format your file name
  "picgo-plugin-filename-format": {
    // format type (e.g. origin/hash/uuid/timestamp/time)
    "format": "hash",
    // format options
    "options": {
      "type": "sha256",
      "length": 16
    }
  }
}

Now you can run picgo u <file path> or upload file by Typora, and the file name will be formatted according to your setting before upload.

If you upload an image call demo.png

// format: origin 
https://cloud.com/images/demo.png

// format: hash 
https://cloud.com/images/F797b746fa17615e.png

// format: uuid 
https://cloud.com/images/b117132a-1df4-47dd-b861-a4a2eb687703.png

// format: timestamp 
https://cloud.com/images/1705770275093.png

// format: time 
https://cloud.com/images/2024-01-01/demo.png // nameFormat: origin
https://cloud.com/images/2024-01-01/F797b746fa17615e.png // nameFormat: hash
https://cloud.com/images/2024-01-01/1705770275093.png // nameFormat: timestamp

API

Basic Configuration

| Field Name | Field Type | Description | | -- | -- | -- | | format | string | Format type (default origin) e.g. origin, uuid, hash, time, timestamp | | options | object | Format options, every format type has different options |

Origin Options

Format type origin need't to set options.

UUID Options

Format type uuid need't to set options.

Hash Options

| Field Name | Field Type | Description | | -- | -- | -- | | type | string | Hash algorithm that supported by OpenSSL (default sha256) e.g. sha256, sha512, etc | | length | number | The hash output length (default 32) e.g. 8, 16, 32, etc |

Example

{
  "format": "hash",
  "options": {
    "type": "sha256",
    "length": 16
  }
}

Timestamp Options

| Field Name | Field Type | Description | | -- | -- | -- | | length | number | The timestamp output length (default 13) e.g. 10, 13 |

Example

{
  "format": "timestamp",
  "options": {
    "length": 13
  }
}

Time Options

| Field Name | Field Type | Description | | -- | -- | -- | | timeFormat | string | Time prefix format template that supported by dayjs (default YYYY-MM-DD) | | nameFormat | string | File name format type, supporting above types (default origin) e.g. origin, uuid, hash, timestamp | | nameOptions | object | File name format options |

Example

{
  "format": "time",
  "options": {
    "timeFormat": "YYYYMMDDHHmmss",
    "nameFormat": "hash",
    "nameOptions": {
      "length": 16
    }
  }
}