I am following the link Twit NPM
to get access to twitter stream .
I do the following
var T = new Twit({
consumer_key: 'key',
consumer_secret: 'key',
access_token: 'key',
access_token_secret: 'key'
});
var stream = T.stream('statuses/sample.json');
stream.on('tweet', function (tweet) {
console.log(tweet)
});
And i get Bad Request Error 401 . Not sure why ,because if i use curl it works.