twii

Twitter SDK for Node.js

Usage no npm install needed!

<script type="module">
  import twii from 'https://cdn.skypack.dev/twii';
</script>

README

Twii

Twitter SDK request with Got

Install

$ npm install twii

Usage

const T = require('Twii');

const t = new T({
    consumerKey: '',
    consumerSecret: '',
    accessToken: '',
    accessTokenSecret: ''
});

API

t.get(uri, params);
t.post(uri, params);

Example

(async () => {
    // GET
    const getResponse = await t.get('statuses/home_timeine', {count: 5});
    console.log(getResponse.body);

    // POST
    const postResponse = await t.post('statuses/update', {status: 'Hi LitoMore'});
    console.log(postReponse.body);
})();

Related

  • twe - CLI for Twitter
  • got - Simplified HTTP requests

License

MIT © LitoMore