{"id":15283920,"url":"https://github.com/skullzarmy/tusk","last_synced_at":"2025-10-07T00:31:43.433Z","repository":{"id":153546072,"uuid":"629791649","full_name":"skullzarmy/Tusk","owner":"skullzarmy","description":"Async Mastodon API Client for node - forked from node-mastodon - which was forked from twit","archived":false,"fork":true,"pushed_at":"2024-08-15T05:08:04.000Z","size":1563,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-09-30T14:48:12.283Z","etag":null,"topics":["axios","mastodon","mastodon-api","node-js"],"latest_commit_sha":null,"homepage":"https://skullzarmy.github.io/Tusk/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hylyh/node-mastodon","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skullzarmy.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}},"created_at":"2023-04-19T03:14:06.000Z","updated_at":"2024-08-15T05:08:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"3805f557-f706-42f7-801e-b0b2169e5310","html_url":"https://github.com/skullzarmy/Tusk","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2FTusk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2FTusk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2FTusk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2FTusk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skullzarmy","download_url":"https://codeload.github.com/skullzarmy/Tusk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877441,"owners_count":16554878,"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":["axios","mastodon","mastodon-api","node-js"],"created_at":"2024-09-30T14:48:13.741Z","updated_at":"2025-10-07T00:31:43.424Z","avatar_url":"https://github.com/skullzarmy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ DEPRECATED - Tusk-Mastodon\n\n## 🚨 This package is deprecated and no longer maintained\n\n**Tusk has been retired and discontinued.** This repository is kept for reference purposes only.\n\n### Migration Guide\n\nPlease migrate to the **[masto](https://www.npmjs.com/package/masto)** package, which is actively maintained and offers more features:\n\n```bash\nnpm install masto\n```\n\nLearn more: https://www.npmjs.com/package/masto\n\nWe thank everyone who used Tusk and wish you success with your migration.\n\n---\n\n# Tusk-Mastodon\n\n[Mastodon](https://github.com/skullzarmy/Tusk) API Client for node - forked from [node-mastodon](https://github.com/hylyh/node-mastodon) [abandoned]\n\n[Source on GitHub](https://github.com/skullzarmy/Tusk) | [Documentation](https://skullzarmy.github.io/Tusk/)\n\n### Notes\n\n- I forked this project and fixed the obvious issues / updated the packages, and replaced `request` with `axios`.\n- I added tests using [Bun.sh](https://bun.sh/) runtime and test environment.\n- Introduced individual HTTP methods (get, post, put, etc.) alongside the generic request method.\n\nIf you find any bugs please open an issue and I will handle it as soon as I can. Thanks!\n\n[![npm](https://img.shields.io/npm/dw/tusk-mastodon?label=NPM%20INSTALLS\u0026style=for-the-badge)](https://www.npmjs.com/package/tusk-mastodon)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/skullzarmy/Tusk/badge.svg?style=flat-square)](https://snyk.io/test/github/skullzarmy/Tusk)\n\n[![maintained with hearth by skullzarmy](https://img.shields.io/badge/maintained%20with%20%E2%99%A5%20by-skullzarmy-ff1515.svg)](https://github.com/skullzarmy)\n\n# Installing\n\n```\nnpm install tusk-mastodon\n```\n\n## Usage:\n\n```javascript\nvar Tusk = require(\"tusk-mastodon\");\n\nvar T = new Tusk({\n    access_token: \"...\",\n    timeout_ms: 60 * 1000, // optional HTTP request timeout to apply to all requests.\n    api_url: \"https://mastodon.social/api/v1/\", // optional, defaults to https://mastodon.social/api/v1/\n});\n```\n\n# Tusk API:\n\n## `var T = new Tusk(config)`\n\nCreate a `Tusk` instance that can be used to make requests to Mastodon's APIs. Only supports oauth2 access tokens (no username/password auth) for security reasons.\n\nI advise that you use the [oauth](https://www.npmjs.com/package/oauth) package to get the user's access_token. More information about how to do that is [on the node-mastodon wiki](https://github.com/jessicahayley/node-mastodon/wiki/Getting-an-access_token-with-the-oauth-package).  \nYou'll need to register your app on Mastodon first as well.\n\nIf authenticating with user context, `config` should be an object of the form:\n\n```\n{\n  access_token: '...'\n}\n```\n\n## `T.get(path, [params], callback)`\n\nGET any of the REST API endpoints.\n\n**path**\n\nThe endpoint to hit.\n\n**params**\n\n(Optional) parameters for the request.\n\n**callback**\n\n`function (err, data, response)`\n\n- `data` is the parsed data received from Mastodon.\n- `response` is the [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage) received from Mastodon.\n\n## `T.post(path, [params], callback)`\n\nPOST any of the REST API endpoints. Same usage as `T.get()`.\n\n## `T.getAuth()`\n\nGet the client's authentication tokens.\n\n## `T.setAuth(tokens)`\n\nUpdate the client's authentication tokens.\n\n# Tests\n\n0. Install Bun\n\n```bash\ncurl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL\n```\n\n1. Run Tests\n\n```bash\nbun test\n```\n\n---\n\n# Examples\n\n### Reading the home timeline\n\n```javascript\nT.get(\"timelines/home\", {}).then((resp) =\u003e console.log(resp.data));\n```\n\n### Upload an image and attach it to a toot\n\n```javascript\nvar id;\nT.post(\"media\", { file: fs.createReadStream(\"path/to/image.png\") }).then((resp) =\u003e {\n    id = resp.data.id;\n    T.post(\"statuses\", { status: \"#selfie\", media_ids: [id] });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskullzarmy%2Ftusk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskullzarmy%2Ftusk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskullzarmy%2Ftusk/lists"}