![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@twitter-api-v2/plugin-rate-limit
Advanced tools
Rate limit plugin for twitter-api-v2
Base plugin to handle rate limit storage. Can be extended with custom stores. By default, rate limits are stored into process memory.
import { TwitterApi } from 'twitter-api-v2'
import { TwitterApiRateLimitPlugin } from '@twitter-api-v2/plugin-rate-limit'
const rateLimitPlugin = new TwitterApiRateLimitPlugin()
const client = new TwitterApi(yourKeys, { plugins: [rateLimitPlugin] })
// ...make requests...
await client.v2.me()
const currentRateLimitForMe = await rateLimitPlugin.v2.getRateLimit('users/me')
console.log(currentRateLimitForMe.limit) // 75
console.log(currentRateLimitForMe.remaining) // 74
console.log(rateLimitPlugin.hasHitRateLimit(currentRateLimitForMe)) // false - .remaining > 0
console.log(rateLimitPlugin.isRateLimitStatusObsolete(currentRateLimitForMe)) // false - reset hasn't been hit yet
Modificators .v1
/.v2
/.v1.stream
/.v1.upload
/.v2.labs
prefixes your endpoint with the good URL (like https://api.twitter.com/2
for .v2
).
You can create a custom store (for Redis, MongoDB, SQL...) to store your rate limit data.
Store is given as the first argument of constructor of TwitterApiRateLimitPlugin
.
A store is a class which implements ITwitterApiRateLimitStore
.
You can find a example of store (the default one) TwitterApiRateLimitMemoryStore
, here.
FAQs
Rate limit plugin for twitter-api-v2
The npm package @twitter-api-v2/plugin-rate-limit receives a total of 1,303 weekly downloads. As such, @twitter-api-v2/plugin-rate-limit popularity was classified as popular.
We found that @twitter-api-v2/plugin-rate-limit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.