{"id":15684064,"url":"https://github.com/zyyv/untinyimg","last_synced_at":"2025-05-06T20:45:51.293Z","repository":{"id":65955953,"uuid":"600036557","full_name":"zyyv/untinyimg","owner":"zyyv","description":"A cli tools of tinypng.","archived":false,"fork":false,"pushed_at":"2024-07-08T06:26:37.000Z","size":1874,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T07:13:57.131Z","etag":null,"topics":["cli","tinypng","untiny","util"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zyyv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-10T12:48:53.000Z","updated_at":"2024-07-08T06:26:41.000Z","dependencies_parsed_at":"2024-07-08T08:16:55.799Z","dependency_job_id":"80596a54-50e9-4f1c-8476-df049fad10de","html_url":"https://github.com/zyyv/untinyimg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"zyyv/starter-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funtinyimg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funtinyimg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funtinyimg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funtinyimg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyyv","download_url":"https://codeload.github.com/zyyv/untinyimg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769129,"owners_count":21801373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","tinypng","untiny","util"],"created_at":"2024-10-03T17:10:32.315Z","updated_at":"2025-05-06T20:45:51.267Z","avatar_url":"https://github.com/zyyv.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# untinyimg [![npm](https://img.shields.io/npm/v/untinyimg.svg)](https://npmjs.com/package/untinyimg)\n\nA cli tools of tinypng.\n\n## Usage\n```shell\nnpm i -D untinyimg\n```\n\n### Cli\n\nYou can use `untiny` command in your terminal\n\n```shell\nuntiny -h # help\n```\n![untiny help](./public/commondLine.png)\n\n#### `untiny ci`\nCompress a single image.\n\n```shell\nuntiny ci ./test.png\n```\n\n#### `untiny cis`\nCompress an array of images.\n\n```shell\nuntiny cis ./test.png ./test2.png\n```\n\n#### `untiny cd`\nCompress all images in the directory.\n\n```shell\nuntiny cd ./test\n```\n\n#### untiny cli options\n\n- `-c` or `--config` your config file path\n- `-k` or `--key` your tinypng api key\n- `-o` or `--out` your output file path\n- `-d` or `--debug` print debug information\n\n### Api\n\n#### `createUntiny`\nCreate your untiny instance.\n\n```ts\nimport { createUntiny } from 'untinyimg'\n\nconst untiny = createUntiny('your api key')\n```\n\n#### `compressDir`\nCompress all images in the directory.\n\n```ts\nuntiny.compressDir('your dir path of images')\n```\n\n#### `compressImages`\nCompress all images with an array.\n\n```ts\nuntiny.compressImages('your file path array of images')\n```\n\n#### `compressImage`\nCompress a image.\n\n```ts\nuntiny.compressImage('your file path of image')\n```\n\n### types\n`compressDir`、`compressImages`、`compressImage` support options in second param.\n\n```ts\nexport interface CompressOption {\n  /**\n   * convert file path to return a new file path\n   * @param originPath origin file path\n   * @param originImgName origin file name\n   * @returns new file path\n   */\n  handler?: (originPath: string, originImgName: string) =\u003e string\n\n  /**\n   * Your desired image types. The following options are available as a type:\n   */\n  convertType?: IMG_TYPE | IMG_TYPE[]\n\n  /**\n   * The transform object specifies the stylistic transformations that will be applied to your image\n   */\n  transform?: string\n\n  /**\n   * Whether to print debug information\n   * @default true\n   */\n  debug?: boolean\n}\n\nexport type IMG_EXT = '.png' | '.jpg' | '.jpeg' | '.webp'\n\nexport type IMG_TYPE = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/jpg' | '*/*'\n```\n\n## License\n\n[MIT](./LICENSE) License © 2023 [zyyv](https://github.com/zyyv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyyv%2Funtinyimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyyv%2Funtinyimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyyv%2Funtinyimg/lists"}