{"_id":"@cammyleone/twitter-api-v2","_rev":"1-885dba69dc4cf3232f623abec2d39eb8","name":"@cammyleone/twitter-api-v2","dist-tags":{"latest":"1.9.0"},"versions":{"1.9.0":{"name":"@cammyleone/twitter-api-v2","version":"1.9.0","description":"Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.","main":"dist/index.js","types":"dist/index.d.ts","keywords":["twitter","api","typed","types","v2","v1.1"],"scripts":{"build":"tsc","build-doc":"typedoc src/index.ts --out tsdocs","lint":"eslint --ext \".ts\" --ignore-path .gitignore .","mocha":"mocha -r ts-node/register --timeout 10000","test":"npm run mocha 'test/**/*.test.ts'","test-tweet":"npm run mocha 'test/tweet.*.test.ts'","test-user":"npm run mocha 'test/user.*.test.ts'","test-stream":"npm run mocha test/stream.test.ts","test-media":"npm run mocha test/media-upload.test.ts","test-auth":"npm run mocha test/auth.test.ts","test-dm":"npm run mocha test/dm.*.test.ts","test-list":"npm run mocha test/list.*.test.ts","test-space":"npm run mocha test/space.v2.test.ts","test-account":"npm run mocha test/account.*.test.ts","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/plhery/node-twitter-api-v2.git"},"author":{"name":"Paul-Louis Hery","email":"paullouis.hery+twitterapi@gmail.com","url":"https://twitter.com/plhery"},"license":"Apache-2.0","devDependencies":{"@types/chai":"^4.2.16","@types/mocha":"^8.2.2","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.28.5","@typescript-eslint/parser":"^4.28.5","chai":"^4.3.4","dotenv":"^8.2.0","eslint":"^7.31.0","mocha":"^8.3.2","ts-node":"^9.1.1","typedoc":"^0.20.35","typescript":"^4.2.4"},"bugs":{"url":"https://github.com/plhery/node-twitter-api/issues"},"gitHead":"1482d2e0cf5a1f5abdb84b7e49b8efd85331e9bf","homepage":"https://github.com/plhery/node-twitter-api-v2#readme","_id":"@cammyleone/twitter-api-v2@1.9.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-l+BK8OLHHEoWuyac/pnkjTMXIjZInArCTkxr8PE2IFfIFpcLyPrh5S+h3vckykcnauv4snpsJjU+XBa8pAQaTA==","shasum":"514262277b4b164fcb9060436e41f982e18f9633","tarball":"https://registry.npmjs.org/@cammyleone/twitter-api-v2/-/twitter-api-v2-1.9.0.tgz","fileCount":135,"unpackedSize":415555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhy/4FCRA9TVsSAnZWagAAGWkP/iWa90e7F6jrE/PQS5Hw\n6NGdhjUf4pLMv+hWEHe81UBqX6SjC1HWKiSaGuM9E0Dp/MfKR6g4G29KNern\ntfcb7827VUZ9EK/XvwouEPug0tSd0uNuhhcRh9M8+oOkOcaUomdmrfkzcd0L\nXzjZyPUZSc83mTQlT+B1UnMVD1dYQ81Lid+sV+sOR4qIJD52lVZzx1vp55Wl\n+kdQZCtOfce6hMaiuqExx2WhPkTFju9i1rA0YjxvpD9M2u8Sd29MspfusME0\naiYZO3tcG4qQteyj4G0t7anMcQ1jNIhCllWBkq4cUhQcIi/9C3FN5qCHQHkK\n+oJWqIDPx1xF+jGMsYKRtT4kXUX8f2mrpqS0WRRv9n+Hio8LSoYNyct4ICqY\nWJmgZQVcfz+TvBO3STjBareV+Zay1XDsqN1E2R1+LqtSsmkrYwjT+/hdpbAb\nrPK8TQFXQHGIoRooBslDmvUxGbDFJAzBEelPdPUY6M2/tBysf/td6i0Mz4V8\nrXwAg53BbP5U7II+mTwo31igInuOxfnTzxxiDLGdyR0mc34QaGnJ91Y/kKvs\nfnJz9zPL6WHl10wdji7iUQBdVNa+dCjdzXYZYHthz7JpS4f2bzk1UTocQhUo\nRkONUC0ha2QFzxlKT2GbKF3jSAtAUnL0Ljkks18VZodZ+mMhynylq1Ak2hY0\nKiiG\r\n=RRol\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/BFUcO/ewBKmIzagbyvpMjnIo1+NS8MKjhazYpgLksAiBfijpjJ4xCmx/XxtBKMUhLTNhNYMrZ10uQ2nKpgkpV2w=="}]},"_npmUser":{"name":"cammyleone","email":"cammy@willyouplease.me"},"directories":{},"maintainers":[{"name":"cammyleone","email":"cammy@willyouplease.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/twitter-api-v2_1.9.0_1640758788729_0.3014610620669518"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-29T06:19:48.683Z","1.9.0":"2021-12-29T06:19:49.267Z","modified":"2022-04-04T21:34:31.133Z"},"maintainers":[{"name":"cammyleone","email":"cammy@willyouplease.me"}],"description":"Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.","homepage":"https://github.com/plhery/node-twitter-api-v2#readme","keywords":["twitter","api","typed","types","v2","v1.1"],"repository":{"type":"git","url":"git+https://github.com/plhery/node-twitter-api-v2.git"},"author":{"name":"Paul-Louis Hery","email":"paullouis.hery+twitterapi@gmail.com","url":"https://twitter.com/plhery"},"bugs":{"url":"https://github.com/plhery/node-twitter-api/issues"},"license":"Apache-2.0","readme":"# Twitter API v2\n\n[![Twitter API v2 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2)](https://developer.twitter.com/en/docs/twitter-api/early-access)\n[![Twitter API v1.1 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard)](https://developer.twitter.com/en/docs/twitter-api/v1)\n[![Version badge](https://badgen.net/github/release/PLhery/node-twitter-api-v2)](https://github.com/PLhery/node-twitter-api-v2)\n[![Checks badge](https://github.com/PLhery/node-twitter-api-v2/actions/workflows/CI.yml/badge.svg)](https://github.com/PLhery/node-twitter-api-v2/actions/workflows/CI.yml)\n[![Package size badge](https://badgen.net/bundlephobia/minzip/twitter-api-v2)](https://bundlephobia.com/package/twitter-api-v2)\n\nStrongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.\n\nMain maintainer: [@alkihis](https://github.com/alkihis) - <a href=\"https://www.buymeacoffee.com/alkihis\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" height=\"20px\" marginTop=\"10px\"></a>\n\n\n## Highlights\n\n✅ **Ready for v2 and good ol' v1.1 Twitter API**\n\n✅ **Light: No dependencies, 17kb minified+gzipped**\n\n✅ **Bundled types for request parameters and responses**\n\n✅ **Streaming support**\n\n✅ **Pagination utils**\n\n✅ **Media upload helpers**\n\n## How to use\n\nInstall it through your favorite package manager:\n```bash\nyarn add twitter-api-v2\n# or\nnpm i twitter-api-v2\n```\n\nHere's is a quick example of usage:\n\n```ts\nimport TwitterApi from 'twitter-api-v2';\n\n// Instanciate with desired auth type (here's Bearer v2 auth)\nconst twitterClient = new TwitterApi('<YOUR_APP_USER_TOKEN>');\n\n// Tell typescript it's a readonly app\nconst roClient = twitterClient.readOnly;\n\n// Play with the built in methods\nconst user = await roClient.v2.userByUsername('plhery');\nawait twitterClient.v1.tweet('Hello, this is a test.');\n// You can upload media easily!\nawait twitterClient.v1.uploadMedia('./big-buck-bunny.mp4');\n```\n\n## Why?\n\nSometimes, you just want to quickly bootstrap an application using the Twitter API.\nEven if they're a lot of available libraries on the JavaScript ecosystem, they usually just\nprovide wrappers around HTTP methods, and some of them are bloated with many dependencies.\n\n`twitter-api-v2` meant to provide full endpoint wrapping, from method name to response data,\nusing descriptive typings for read/write/DMs rights, request parameters and response payload.\n\nA small feature comparaison with other libs:\n\n| Package        | API version(s) | Response typings | Media helpers | Pagination | Subdeps |  Size (gzip)  | Install size  |\n| -------------- | -------------- | ---------------- | ------------- | ---------- | --------------- | -------------:|  -------------:|\n| twitter-api-v2 | v1.1, v2, labs | ✅               | ✅             | ✅         | 0               | ~17 kB      | [![twitter-api-v2 install size badge](https://badgen.net/packagephobia/install/twitter-api-v2)](https://packagephobia.com/result?p=twitter-api-v2) |\n| twit           | v1.1           | ❌               | ✅             | ❌         | 51              | ~214.5 kB     | [![twit install size badge](https://badgen.net/packagephobia/install/twit)](https://packagephobia.com/result?p=twit) |\n| twitter        | v1.1           | ❌               | ❌             | ❌         | 50              | ~182.1 kB     | [![twitter install size badge](https://badgen.net/packagephobia/install/twitter)](https://packagephobia.com/result?p=twitter) |\n| twitter-lite   | v1.1, v2       | ❌               | ❌*            | ❌         | 4               | ~5.3 kB       | [![twitter-lite install size badge](https://badgen.net/packagephobia/install/twitter-lite)](https://packagephobia.com/result?p=twitter-lite) |\n| twitter-v2     | v2             | ❌               | ❌             | ❌         | 7               | ~4.5 kB       | [![twitter-v2 install size badge](https://badgen.net/packagephobia/install/twitter-v2)](https://packagephobia.com/result?p=twitter-v2) |\n\n\\**No support for `media/upload`, cannot send a `multipart/form-data` encoded-body without tricks*\n\n## Features\n\nHere's the detailed feature list of `twitter-api-v2`:\n\n### Basics:\n- Support for v1.1 and **v2 of Twitter API**\n- Make signed HTTP requests to Twitter with every auth type: **OAuth 1.0a**, **OAuth2** (even brand new user context OAuth2!) and **Basic** HTTP Authorization\n- Helpers for numerous HTTP request methods (`GET`, `POST`, `PUT`, `DELETE` and `PATCH`),\n  that handle query string parse & format, automatic body formatting and more\n- High-class support for stream endpoints, with easy data consumption and auto-reconnect on stream errors\n\n### Request helpers:\n- Automatic paginator for endpoints like user and tweet timelines,\n  allowing payload consumption with modern asynchronous iterators until your rate-limit is hit\n- Convenient methods for authentication - generate auth links and ask for tokens to your users will be a breeze\n- Media upload with API v1.1, including **long video & subtitles support**, automatic media type detection,\n  **chunked upload** and support for **concurrent uploads**\n- Dedicated methods that wraps API v1.1 & v2 endpoints, with **typed arguments** and fully **typed responses**\n- Bundled parsing of rate limit headers\n- Typed errors, meaningful error messages, error enumerations for both v1.1 and v2\n\n### Type-safe first:\n- **Typings for tweet, user, media entities (and more) are bundled!**\n- Type-safe wrapping of dedicated methods in 3 right level: *DM*/*Read-write*/*Read-only* (just like Twitter API do!) -\n  you can declare a read-only client - you will only see the methods associated with read-only endpoints\n\nAnd last but not least, fully powered by native `Promise`s.\n\n## Documentation\n\nLearn how to use the full potential of `twitter-api-v2`.\n\n- Get started\n  - [Create a client and make your first request](./doc/basics.md)\n  - [Handle Twitter authentication flows](./doc/auth.md)\n  - [Explore some examples](./doc/examples.md)\n- Use endpoints wrappers — ensure typings of request & response\n  - [Available endpoint wrappers for v1.1 API](./doc/v1.md)\n  - [Available endpoint wrappers for v2 API](./doc/v2.md)\n  - [Use Twitter streaming endpoints (v1.1 & v2)](./doc/streaming.md)\n- Deep diving into requests\n  - [Use direct HTTP-method wrappers](./doc/http-wrappers.md)\n  - [Use rate limit helpers](./doc/rate-limiting.md)\n  - [Handle errors](./doc/errors.md)\n  - [Master `twitter-api-v2` paginators](./doc/paginators.md)\n  - [Discover available helpers](./doc/helpers.md)\n","readmeFilename":"README.md"}