
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@hoprnet/twitter-api-client
Advanced tools
Node.js client for Twitter API
☑️ Includes 90% of the official Twitter API endpoints.
☑️ Promise-based! No ugly callbacks.
☑️ Fully typed! Both for query parameters and responses.
☑️ Inbuilt in-memory cache for rate-limit friendly usage.
You will need to create a set of Twitter developer credentials from your Twitter Developer account.
If you don't have one already, apply for a developer account here.
It takes about 5 minutes.
npm i twitter-api-client
import TwitterClient from 'twitter-api-client';
const twitterClient = new TwitterClient({
apiKey: '<YOUR-TWITTER-API-KEY>',
apiSecret: '<YOUR-TWITTER-API-SECRET>',
accessToken: '<YOUR-TWITTER-ACCESS-TOKEN>',
accessTokenSecret: '<YOUR-TWITTER-ACCESS-TOKEN-SECERT>',
});
// Search for a user
const data = await twitterClient.accountsAndUsers.usersSearch({ q: 'twitterDev' });
// Get message event by Id
const data = await twitterClient.directMessages.directMessagesEventsShow({ id: '1234' });
// Get most recent 25 retweets of a tweet
const data = await twitterClient.tweets.statusesRetweetsById({ id: '12345', count: 25 });
// Get local trends
const data = await twitterClient.trends.trendsAvailable();
See all available methods here.
twitter-api-client
comes with an inbuilt in-memory cache.
The stale data is served by the cache-first principle.
You can configure the caching behavior upon instantiation of the client:
const twitterClient = new TwitterClient({
apiKey: '<YOUR-TWITTER-API-KEY>',
apiSecret: '<YOUR-TWITTER-API-SECRET>',
accessToken: '<YOUR-TWITTER-ACCESS-TOKEN>',
accessTokenSecret: '<YOUR-TWITTER-ACCESS-TOKEN-SECERT>',
ttl: 120, // seconds. Defaults to 360
disableCache: true, // Disables the caching behavior. Defaults to 'false'
maxByteSize: 32000000, // Maximum (approximated) memory size for cache store. Defaults to 16000000.
});
This project is licensed under the MIT License
In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.
Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.
FAQs
Node.js / JavaScript client for Twitter API
The npm package @hoprnet/twitter-api-client receives a total of 17 weekly downloads. As such, @hoprnet/twitter-api-client popularity was classified as not popular.
We found that @hoprnet/twitter-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.