{"_id":"@cesarlai/picgo-plugin-filename-format","_rev":"2-591f3ae6c07e6db04b52b8c4c0dda3ea","name":"@cesarlai/picgo-plugin-filename-format","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@cesarlai/picgo-plugin-filename-format","version":"0.1.0","keywords":["picgo","picgo-plugin","format","typescript"],"author":{"name":"Cesar Lai"},"license":"MIT","_id":"@cesarlai/picgo-plugin-filename-format@0.1.0","maintainers":[{"name":"cesarlai","email":"npm@cesarlai.com"}],"homepage":"https://github.com/CesarLai/picgo-plugin-filename-format#readme","bugs":{"url":"https://github.com/CesarLai/picgo-plugin-filename-format/issues"},"dist":{"shasum":"29a134cfa09419e7f30242ccdc43a955e086a1b9","tarball":"https://registry.npmjs.org/@cesarlai/picgo-plugin-filename-format/-/picgo-plugin-filename-format-0.1.0.tgz","fileCount":46,"integrity":"sha512-23EXKPEav/T65BNKxAnAF0NsJpXDmUSxzW+ug8lRWfTIR7X7I+K4mb+yd1YPZrfFUAo/92ORnl0aWVOBqhYNOg==","signatures":[{"sig":"MEUCIQDolf9gYkscP2mjqjxiKYd5bUk+WMyPtvfp1E3ZDAOjCAIgPs/9STBWeII6G8pPY6GksWMx6Z3Fzukeir5+qioGco0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51057},"main":"dist/index.js","type":"commonjs","_from":"file:cesarlai-picgo-plugin-filename-format-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"npm":">= 6.11.0","node":">= 12.0.0"},"scripts":{"build":"rimraf dist && tspc","prepublish":"npm run build"},"_npmUser":{"name":"cesarlai","email":"npm@cesarlai.com"},"_resolved":"/tmp/39db2f2a5cec87e8553f9784805bc240/cesarlai-picgo-plugin-filename-format-0.1.0.tgz","_integrity":"sha512-23EXKPEav/T65BNKxAnAF0NsJpXDmUSxzW+ug8lRWfTIR7X7I+K4mb+yd1YPZrfFUAo/92ORnl0aWVOBqhYNOg==","repository":{"url":"git+ssh://git@github.com/CesarLai/picgo-plugin-filename-format.git","type":"git"},"_npmVersion":"8.19.4","description":"A picgo plugin to format filename by your setting.","directories":{},"_nodeVersion":"16.20.2","dependencies":{"uuid":"9.0.1","dayjs":"1.11.10","tslib":"2.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@8.11.0","devDependencies":{"picgo":"1.5.0-alpha.13","rimraf":"5.0.5","ts-patch":"3.1.1","typescript":"5.0.2","@types/node":"16.9.1","@types/uuid":"9.0.7","typescript-transform-paths":"3.4.6"},"_npmOperationalInternal":{"tmp":"tmp/picgo-plugin-filename-format_0.1.0_1705806999848_0.12276333644003024","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@cesarlai/picgo-plugin-filename-format","version":"0.1.1","keywords":["picgo","picgo-plugin","format","typescript"],"author":{"name":"Cesar Lai"},"license":"MIT","_id":"@cesarlai/picgo-plugin-filename-format@0.1.1","maintainers":[{"name":"cesarlai","email":"npm@cesarlai.com"}],"homepage":"https://github.com/CesarLai/picgo-plugin-filename-format#readme","bugs":{"url":"https://github.com/CesarLai/picgo-plugin-filename-format/issues"},"dist":{"shasum":"41fb88c848a717ee69aba575782bd23228303eb0","tarball":"https://registry.npmjs.org/@cesarlai/picgo-plugin-filename-format/-/picgo-plugin-filename-format-0.1.1.tgz","fileCount":49,"integrity":"sha512-KI08T97JkTaVxc8LwhLyXoUjHxfKQVGJFJ8u9ZZfO2xf2hQVBs4QTyegphRl5o6ZIS3SZC1CFW2IwWAGQhtqTg==","signatures":[{"sig":"MEYCIQDG1yQHfBkPf9C8ylc1nPTW5pr2D5z6ODaU+IoKB58u7wIhAI0Zf2nwlHDTkWZbIS3CTJTMVtBiglKs7+qEp4b1NiTJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52651},"main":"dist/index.js","type":"commonjs","_from":"file:cesarlai-picgo-plugin-filename-format-0.1.1.tgz","types":"./dist/index.d.ts","engines":{"npm":">= 6.11.0","node":">= 12.0.0"},"scripts":{"build":"rimraf dist && tspc","prepublish":"npm run build"},"_npmUser":{"name":"cesarlai","email":"npm@cesarlai.com"},"_resolved":"/tmp/ef18a7493636690542a82c51fc60cae6/cesarlai-picgo-plugin-filename-format-0.1.1.tgz","_integrity":"sha512-KI08T97JkTaVxc8LwhLyXoUjHxfKQVGJFJ8u9ZZfO2xf2hQVBs4QTyegphRl5o6ZIS3SZC1CFW2IwWAGQhtqTg==","repository":{"url":"git+ssh://git@github.com/CesarLai/picgo-plugin-filename-format.git","type":"git"},"_npmVersion":"8.19.4","description":"A picgo plugin to format filename by your setting.","directories":{},"_nodeVersion":"16.20.2","dependencies":{"uuid":"9.0.1","dayjs":"1.11.10","tslib":"2.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@8.11.0","devDependencies":{"picgo":"1.5.0-alpha.13","rimraf":"5.0.5","ts-patch":"3.1.1","typescript":"5.0.2","@types/node":"16.9.1","@types/uuid":"9.0.7","typescript-transform-paths":"3.4.6"},"_npmOperationalInternal":{"tmp":"tmp/picgo-plugin-filename-format_0.1.1_1705820239168_0.5470793207497935","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@cesarlai/picgo-plugin-filename-format","version":"0.1.2","author":{"name":"Cesar Lai"},"description":"A picgo plugin to format filename by your setting.","main":"dist/index.js","license":"MIT","type":"commonjs","keywords":["picgo","picgo-plugin","format","typescript"],"repository":{"type":"git","url":"git+ssh://git@github.com/CesarLai/picgo-plugin-filename-format.git"},"publishConfig":{"access":"public"},"packageManager":"pnpm@8.11.0","engines":{"node":">= 12.0.0","npm":">= 6.11.0"},"dependencies":{"dayjs":"1.11.10","uuid":"9.0.1","tslib":"2.6.2"},"devDependencies":{"@types/node":"16.9.1","@types/uuid":"9.0.7","picgo":"1.5.0-alpha.13","rimraf":"5.0.5","ts-patch":"3.1.1","typescript":"5.0.2","typescript-transform-paths":"3.4.6"},"scripts":{"prepublish":"npm run build","build":"rimraf dist && tspc"},"types":"./dist/index.d.ts","bugs":{"url":"https://github.com/CesarLai/picgo-plugin-filename-format/issues"},"homepage":"https://github.com/CesarLai/picgo-plugin-filename-format#readme","_id":"@cesarlai/picgo-plugin-filename-format@0.1.2","_integrity":"sha512-GpymynNttsPSb1bNNE0LhDVm9owuv6UAETF+eiBQjSnllKLTy2i/EBolNSQlms45Nxpq57652CtbjfMeWpuaBA==","_resolved":"/tmp/1315541175d229e6280595e2f602f509/cesarlai-picgo-plugin-filename-format-0.1.2.tgz","_from":"file:cesarlai-picgo-plugin-filename-format-0.1.2.tgz","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-GpymynNttsPSb1bNNE0LhDVm9owuv6UAETF+eiBQjSnllKLTy2i/EBolNSQlms45Nxpq57652CtbjfMeWpuaBA==","shasum":"2a631a6ca9a37f737c7b0663da911affd09536a6","tarball":"https://registry.npmjs.org/@cesarlai/picgo-plugin-filename-format/-/picgo-plugin-filename-format-0.1.2.tgz","fileCount":52,"unpackedSize":55863,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR8B5plMFwu8r/mZPyu8czogYW7Lq+7awZgYQKKpeZ1gIhAL1HsscQ3Ah1ms2VuoOq43lM2Atl2ZYcNZkjm/gTyhol"}]},"_npmUser":{"name":"cesarlai","email":"npm@cesarlai.com"},"directories":{},"maintainers":[{"name":"cesarlai","email":"npm@cesarlai.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/picgo-plugin-filename-format_0.1.2_1730017503027_0.12763982413358343"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-21T03:16:39.769Z","modified":"2024-10-27T08:25:03.431Z","0.1.0":"2024-01-21T03:16:40.047Z","0.1.1":"2024-01-21T06:57:19.334Z","0.1.2":"2024-10-27T08:25:03.237Z"},"bugs":{"url":"https://github.com/CesarLai/picgo-plugin-filename-format/issues"},"author":{"name":"Cesar Lai"},"license":"MIT","homepage":"https://github.com/CesarLai/picgo-plugin-filename-format#readme","keywords":["picgo","picgo-plugin","format","typescript"],"repository":{"type":"git","url":"git+ssh://git@github.com/CesarLai/picgo-plugin-filename-format.git"},"description":"A picgo plugin to format filename by your setting.","maintainers":[{"name":"cesarlai","email":"npm@cesarlai.com"}],"readme":"# picgo-plugin-filename-format\n\nA picgo plugin to format filename by your setting.\n\nYou can use this plugin with Typora to format file name before upload.\n\n## Installation\n\n```sh\n# Mac\ncd ~/.picgo\nnpm i --save picgo-plugin-filename-format@npm:@cesarlai/picgo-plugin-filename-format\n# Windows\ncd C:\\\\Users\\\\<Your User Name>\\\\.picgo\nnpm i --save picgo-plugin-filename-format@npm:@cesarlai/picgo-plugin-filename-format\n```\n\n## Usage\n\nAfter install this plugin, you should edit `.picgo/config.json` like this\n\n```jsonc\n{\n  \"picBed\": {\n    \"uploader\": \"aliyun\",\n    \"aliyun\": {\n      // ...\n    },\n    \"current\": \"aliyun\"\n  },\n  \"picgoPlugins\": {\n    // use this plugin\n    \"picgo-plugin-filename-format\": true\n  },\n  // config how to format your file name\n  \"picgo-plugin-filename-format\": {\n    // format type (e.g. origin/hash/uuid/timestamp/time)\n    \"format\": \"hash\",\n    // format options\n    \"options\": {\n      \"type\": \"sha256\",\n      \"length\": 16\n    }\n  }\n}\n```\n\nNow you can run `picgo u <file path>` or upload file by **[Typora](https://typora.io)**, and the file name will be formatted according to your setting before upload.\n\nIf you upload an image call demo.png\n\n```txt\n// format: origin \nhttps://cloud.com/images/demo.png\n\n// format: hash \nhttps://cloud.com/images/F797b746fa17615e.png\n\n// format: uuid \nhttps://cloud.com/images/b117132a-1df4-47dd-b861-a4a2eb687703.png\n\n// format: timestamp \nhttps://cloud.com/images/1705770275093.png\n\n// format: time \nhttps://cloud.com/images/2024-01-01/demo.png // nameFormat: origin\nhttps://cloud.com/images/2024-01-01/F797b746fa17615e.png // nameFormat: hash\nhttps://cloud.com/images/2024-01-01/1705770275093.png // nameFormat: timestamp\n```\n\n## API\n\n### Basic Configuration\n\n| Field Name | Field Type | Description |\n| -- | -- | -- |\n| format | string | Format type (default `origin`) <br> e.g. `origin`, `uuid`, `hash`, `time`, `timestamp` |\n| options | object | Format options, every format type has different options |\n\n### Origin Options\n\nFormat type `origin` need't to set options.\n\n### UUID Options\n\nFormat type `uuid` need't to set options.\n\n### Hash Options\n\n| Field Name | Field Type | Description |\n| -- | -- | -- |\n| type | string | Hash algorithm that supported by OpenSSL (default `sha256`) <br> e.g. `sha256`, `sha512`, etc |\n| length | number | The hash output length (default `32`) <br> e.g. `8`, `16`, `32`, etc |\n\nExample\n\n```jsonc\n{\n  \"format\": \"hash\",\n  \"options\": {\n    \"type\": \"sha256\",\n    \"length\": 16\n  }\n}\n```\n\n### Timestamp Options\n\n| Field Name | Field Type | Description |\n| -- | -- | -- |\n| length | number | The timestamp output length (default `13`) <br> e.g. `10`, `13` |\n\nExample\n\n```jsonc\n{\n  \"format\": \"timestamp\",\n  \"options\": {\n    \"length\": 13\n  }\n}\n```\n\n### Time Options\n\n| Field Name | Field Type | Description |\n| -- | -- | -- |\n| timeFormat | string | Time prefix format template that supported by [dayjs](https://github.com/iamkun/dayjs) (default `YYYY-MM-DD`) |\n| nameFormat | string | File name format type, supporting above types (default `origin`) <br> e.g. `origin`, `uuid`, `hash`, `timestamp` |\n| nameOptions | object | File name format options |\n\nExample\n\n```jsonc\n{\n  \"format\": \"time\",\n  \"options\": {\n    \"timeFormat\": \"YYYYMMDDHHmmss\",\n    \"nameFormat\": \"hash\",\n    \"nameOptions\": {\n      \"length\": 16\n    }\n  }\n}\n```\n","readmeFilename":"README.md"}