How to Handle Async Code in JavaScript

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • superagent

    Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.

    You are using Superagent and RSS parser to get the task done. Superagent and RSS parser both support callback and the Promises API (coming up next). If this code was written for the backend with Node.js, we wouldn't need the CORS proxy. It is needed for the frontend.

  • nitter

    Alternative Twitter front-end

    const request = window.superagent; const parser = new RSSParser(); const CORS_PROXY = "https://cors-anywhere.herokuapp.com/"; async function getLatestTweet(githubUsername) { try { const gitHubResponse = await request .get(`https://api.github.com/users/${githubUsername}`) .set("Accept", "application/json"); console.log("Twitter Username: ", gitHubResponse.body.twitter_username); const twitterUsername = gitHubResponse.body.twitter_username; const feed = await parser.parseURL( `${CORS_PROXY}https://nitter.net/${twitterUsername}/rss` ); console.log( `The last tweet by ${twitterUsername} is - ${feed.items[0].title}` ); } catch (err) { console.log(`Error occurred ${err.message}`, err); } } getLatestTweet("abraham"); console.log("This would log first");

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts