{"id":19234468,"url":"https://github.com/depthbomb/node-catbox","last_synced_at":"2026-02-19T22:11:34.358Z","repository":{"id":37260706,"uuid":"459404698","full_name":"depthbomb/node-catbox","owner":"depthbomb","description":"A library for interacting with Catbox.moe written in TypeScript with no dependencies.","archived":false,"fork":false,"pushed_at":"2026-01-30T16:26:29.000Z","size":10542,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T08:41:19.388Z","etag":null,"topics":[],"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/depthbomb.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"patreon":"depthbomb","ko_fi":"depthbomb","custom":["https://www.amazon.com/hz/wishlist/ls/16NXZATT9GHDA"]}},"created_at":"2022-02-15T02:53:22.000Z","updated_at":"2026-01-30T16:26:33.000Z","dependencies_parsed_at":"2024-04-12T00:40:30.325Z","dependency_job_id":"6a85287c-a404-4232-a40e-7ed81695251a","html_url":"https://github.com/depthbomb/node-catbox","commit_stats":{"total_commits":55,"total_committers":1,"mean_commits":55.0,"dds":0.0,"last_synced_commit":"4cd50e9b8cf81b1a0d59ac4a063049502162f7e7"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/depthbomb/node-catbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depthbomb%2Fnode-catbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depthbomb%2Fnode-catbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depthbomb%2Fnode-catbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depthbomb%2Fnode-catbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/depthbomb","download_url":"https://codeload.github.com/depthbomb/node-catbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depthbomb%2Fnode-catbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29634843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T16:13:49.692Z","updated_at":"2026-02-19T22:11:34.329Z","avatar_url":"https://github.com/depthbomb.png","language":"TypeScript","funding_links":["https://patreon.com/depthbomb","https://ko-fi.com/depthbomb","https://www.amazon.com/hz/wishlist/ls/16NXZATT9GHDA"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n\t\u003ctable\u003e\r\n\t\t\u003ctbody\u003e\r\n\t\t\t\u003ctd align=\"center\"\u003e\r\n\t\t\t\t\u003ch1\u003enode-catbox\u003c/h1\u003e\r\n\t\t\t\t\u003cp\u003eA library for interacting with Catbox.moe written in TypeScript with no dependencies.\u003c/p\u003e\r\n\t\t\t\t\u003cp\u003e\r\n\t\t\t\t\t\u003ca href=\"https://www.npmjs.com/package/node-catbox\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/node-catbox?color=crimson\u0026label=node-catbox\u0026logo=npm\"\u003e\u003c/a\u003e\r\n\t\t\t\t\t\u003ca href=\"https://www.npmjs.com/package/node-catbox\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/node-catbox?color=crimson\u0026logo=npm\"\u003e\u003c/a\u003e\r\n\t\t\t\t\t\u003ca href=\"https://www.npmjs.com/package/node-catbox\"\u003e\u003cimg src=\"https://img.shields.io/librariesio/release/npm/node-catbox?color=crimson\u0026logo=npm\"\u003e\u003c/a\u003e\r\n\t\t\t\t\u003c/p\u003e\r\n\t\t\t\t\u003cp\u003e\r\n\t\t\t\t\t\u003ca href=\"https://github.com/depthbomb/node-catbox/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/release-date/depthbomb/node-catbox.svg?label=Released\u0026logo=github\"\u003e\u003c/a\u003e\r\n\t\t\t\t\t\u003ca href=\"https://github.com/depthbomb/node-catbox/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/release/depthbomb/node-catbox.svg?label=Stable\u0026logo=github\"\u003e\u003c/a\u003e\r\n\t\t\t\t\t\u003ca href=\"https://github.com/depthbomb/node-catbox\"\u003e\u003cimg src=\"https://img.shields.io/github/repo-size/depthbomb/node-catbox.svg?label=Repo%20Size\u0026logo=github\"\u003e\u003c/a\u003e\r\n\t\t\t\t\u003c/p\u003e\r\n\t\t\t\t\u003cimg width=\"2000\" height=\"0\"\u003e\r\n\t\t\t\u003c/td\u003e\r\n\t\t\u003c/tbody\u003e\r\n\t\u003c/table\u003e\r\n\u003c/p\u003e\r\n\r\nThis library aims to be a sort of successor to [https://www.npmjs.com/package/catbox.moe](https://www.npmjs.com/package/catbox.moe).\r\n\r\n# Requirements\r\n\r\n- \\\u003e= Node.js 19\r\n\r\n# Installation\r\n\r\n```sh\r\nnpm i node-catbox\r\n\r\n# or\r\n\r\nyarn add node-catbox\r\n```\r\n\r\n# Usage\r\n\r\n### Uploading to Catbox\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\nconst catbox = new Catbox();\r\n\r\ntry {\r\n\tconst response = await catbox.uploadFile({\r\n\t\tpath: '/path/to/my/file.ext'\r\n\t});\r\n\t// or to upload from direct file URL\r\n\tconst response = await catbox.uploadURL({\r\n\t\turl: 'https://i.imgur.com/8rR6IZn.png'\r\n\t});\r\n\r\n\tconsole.log(response); // -\u003e https://files.catbox.moe/XXXXX.ext\r\n} catch (err) {\r\n\tconsole.error(err); // -\u003e error message from server\r\n}\r\n```\r\n\r\n### User Hash\r\n\r\nSome operations require your account's user hash which can be set on instantiation with\r\n```ts\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n```\r\n... or later with\r\n```ts\r\nconst catbox = new Catbox();\r\n\r\nconst catbox.setUserHash('098f6bcd4621d373cade4e832');\r\n```\r\n\r\n### Deleting Files\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\n// user hash required\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n\r\nawait catbox.deleteFiles({\r\n\tfiles: ['XXXXX.ext']\r\n});\r\n```\r\n\r\n### Creating an album\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\n// user hash only required if you plan to edit or delete the album later\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n\r\nconst albumURL = await catbox.createAlbum({\r\n\ttitle: 'album title',\r\n\tdescription: 'album description', // optional\r\n\tfiles: ['XXXXX.ext'] // optional\r\n});\r\n```\r\n\r\n### Editing an album\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\n// user hash required\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n\r\nawait catbox.editAlbum({\r\n\tid: 'YYYYY',\r\n\ttitle: 'new title',\r\n\tdescription: 'new description', // optional\r\n\tfiles:  ['WWWWW.ext', 'VVVVV.ext'] // optional\r\n});\r\n```\r\n\r\n\u003e **Warning**\r\n\u003e This is a potentially destructive method where values are applied to the album directly. Consider using the method below if you are only adding/removing files from an album.\r\n\r\n### Adding and removing files from an album\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\n// user hash required\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n\r\nawait catbox.addFilesToAlbum({\r\n\tid: 'YYYYY',\r\n\tfiles: ['ZZZZZ.ext']\r\n});\r\nawait catbox.removeFilesFromAlbum({\r\n\tid: 'YYYYY',\r\n\tfiles: ['ZZZZZ.ext']\r\n});\r\n```\r\n\r\n### Deleting an album\r\n\r\n```ts\r\nimport { Catbox } from 'node-catbox';\r\n\r\n// user hash required\r\nconst catbox = new Catbox('098f6bcd4621d373cade4e832');\r\n\r\nawait catbox.deleteAlbum({\r\n\tid: 'YYYYY'\r\n});\r\n```\r\n\r\n### Uploading to Litterbox\r\n\r\n```ts\r\nimport { Litterbox } from 'node-catbox';\r\n\r\nconst litterbox = new Litterbox();\r\n\r\nawait litterbox.upload({\r\n\tpath: '/path/to/my/file.ext',\r\n\tduration: '12h' // or omit to default to 1h\r\n});\r\n```\r\n\r\n# Logging requests\r\n\r\nAs of 3.2.0, `node:diagnostics_channel` may be utilized to retrieve the request info that is sent to the API. The example below shows how to log the request info:\r\n\r\n```ts\r\nimport { subscribe } from 'diagnostics_channel';\r\nimport { kCatboxRequestCreate } from 'node-catbox';\r\n// kLitterboxRequestCreate is also available\r\n\r\nsubscribe(kCatboxRequestCreate, (data: any) =\u003e {\r\n\tconst request: RequestInit = data.request;\r\n\r\n\tconsole.log(request);\r\n});\r\n```\r\n\r\n# Testing\r\n\r\nBefore you test the library you need to provide your Catbox account's user hash. Create a `.env` file in the project root and set the `USER_HASH` value to your account's user hash.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepthbomb%2Fnode-catbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepthbomb%2Fnode-catbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepthbomb%2Fnode-catbox/lists"}