Q:

How can I get certain parameters of tweets to save them into a file using json.stringify? (Method I use works for Stream but not for GET)

I am trying to save into a file only user @screen_name and text of the tweet I get using the Twitter API and I cant find any documentation for this on Twitter API website or json.strinigify docs. The code I am using, which doesn't really work with GET for some reason, is this (I cant find anything related to solving my problem in Google):
var params = {q: '@Avengers, count: 1, include_rts: 1};
client.get('search/tweets', params, function(error, tweets, response) {
if (!error) {
    console.log(tweets);
    fs.appendFile("tweet.txt", JSON.stringify(tweets.text), function (err) {
    //user.name or .text doesn't work in GET and I am trying to find the methods
    //that work for GET 
        if (err) throw err;
            console.log('Saved!');
        }); 
    }
});

When I use something similar using Stream, it does work and it saves both the username that posted the tweet and the text of the tweet (which is what I need). My problem here is that stream doesn't have any method to get tweets with the user @screen_name, so I proceded to use GET method. My stream code for doing this is below:
var stream = client.stream('statuses/filter', {track: 'Avengers'});
    stream.on('data', function(event) {
        console.log("Tweeted by ::::>>>" + event.user.name + " ::::>>> " +  "Tweet is :::>>>> " + event.text + " ::::>>>");
        fs.appendFile("tweet.txt", JSON.stringify(event.user.name+' ////////'+event.text)+"\n", function (err) {
        if (err) throw err;
        console.log('Saved!');
    });
});

My result with the GET method is a big mess of parameters I don't need when it saves in the file:
 "statuses": [
  {
   "created_at": "Sun Sep 23 05:03:17 +0000 2018",
   "id": 1043727480572522500,
   "id_str": "1043727480572522496",
   "text": "@Avengers Gamora, Dr Strange and Vision all made comment about dying before given up Stones in 1st 45 minutes. Gett… --------OtAEPXbih4",
   "truncated": true,
   "entities": {
    "hashtags": [],
    "symbols": [],
    "user_mentions": [
     {
      "screen_name": "Avengers",
      "name": "The Avengers",
      "id": 393852070,
      "id_str": "393852070",
      "indices": [
       0,
       9
      ]
     }
    ],
    "urls": [
     {
      "url": "--------OtAEPXbih4",
      "expanded_url": "--------i/web/status/1043727480572522496",
      "display_url": "twitter.com/i/web/status/1…",
      "indices": [
       117,
       140
      ]
     }
    ]
   },
   "metadata": {
    "iso_language_code": "en",
    "result_type": "recent"
   },
   "source": "<a href=\"--------#!/download/ipad\" rel=\"nofollow\">Twitter for iPad</a>",
   "in_reply_to_status_id": null,
   "in_reply_to_status_id_str": null,
   "in_reply_to_user_id": 393852070,
   "in_reply_to_user_id_str": "393852070",
   "in_reply_to_screen_name": "Avengers",
   "user": {
    "id": 1558865406,
    "id_str": "1558865406",
    "name": "john sabo",
    "screen_name": "saybow1969",
    "location": "",
    "description": "",
    "url": null,
    "entities": {
     "description": {
      "urls": []
     }
    },
    "protected": false,
    "followers_count": 52,
    "friends_count": 397,
    "listed_count": 5,
    "created_at": "Sun Jun 30 20:40:04 +0000 2013",
    "favourites_count": 680,
    "utc_offset": null,
    "time_zone": null,
    "geo_enabled": true,
    "verified": false,
    "statuses_count": 24062,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "is_translation_enabled": false,
    "profile_background_color": "C0DEED",
    "profile_background_image_url": "----://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_image_url_----": "----://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_tile": false,
    "profile_image_url": "----://pbs.twimg.com/profile_images/825511373396439040/zZf_Z9Hu_normal.jpg",
    "profile_image_url_----": "----://pbs.twimg.com/profile_images/825511373396439040/zZf_Z9Hu_normal.jpg",
    "profile_banner_url": "----://pbs.twimg.com/profile_banners/1558865406/1486454716",
    "profile_link_color": "1DA1F2",
    "profile_sidebar_border_color": "C0DEED",
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_text_color": "333333",
    "profile_use_background_image": true,
    "has_extended_profile": false,
    "default_profile": true,
    "default_profile_image": false,
    "following": false,
    "follow_request_sent": false,
    "notifications": false,
    "translator_type": "none"
   },
   "geo": null,
   "coordinates": null,
   "place": null,
   "contributors": null,
   "is_quote_status": false,
   "retweet_count": 0,
   "favorite_count": 0,
   "favorited": false,
   "retweeted": false,
   "lang": "en"
  }
 ],
 "search_metadata": {
  "completed_in": 0.015,
  "max_id": 1043727480572522500,
  "max_id_str": "1043727480572522496",
  "next_results": "?max_id=1043727480572522495&q=%40Avengers&count=1&include_entities=1",
  "query": "%40Avengers",
  "refresh_url": "?since_id=1043727480572522496&q=%40Avengers&include_entities=1",
  "count": 1,
  "since_id": 0,
  "since_id_str": "0"
 }
}

My Stream method does this correctly but my GET doesn't, and this is what my stream gives me: 
"Trash Flaten ////////@lliejuve @lliejuve on current tv it has to be the voice actor for Thor in Disney's Avengers Assemble. So o respect…

As you can see, Stream gives me the user @screen_name and the text of the tweet which is what I need, but in the GET method user.name and .text just doesnt do it.

A:

var params = {q: '@Avengers, count: 1, include_rts: 1};
client.get('search/tweets', params, function(error, tweets, response) {
if (!error) {
    console.log(tweets);
    fs.appendFile("tweet.txt", JSON.stringify(tweets.statuses[0].text), function (err) {
        if (err) throw err;
            console.log('Saved!');
        }); 
    }
});

Try this above change. It should work.

