Skip to content

Instantly share code, notes, and snippets.

ECMAScript6 allows programmers to write programs in an asynchronous style, in order to achieve higher performance through concurrency. Such features as the async/await syntax mean that asynchronous functions can be written in a natural way that reads similar to straight-line code. The function can be suspended midway through execution until a result arrives that allows it to continue.

Here is an example which shows how you can use this syntax to implement a function that suspends in the middle of execution until it has received a response to the HTTP request we sent.

const fetch = require("node-fetch");

async function getJson(url) {
  try {
--- perl-5.26.2-orig-util.c 2018-09-20 18:00:03.455252440 +0100
+++ perl-5.26.2-edited-util.c 2018-09-20 18:03:31.026429614 +0100
@@ -4814,7 +4814,7 @@
/* -DPERL_MEM_LOG_SPRINTF_BUF_SIZE=X: size of a (stack-allocated) buffer
* the Perl_mem_log_...() will use (either via sprintf or snprintf).
/* -DPERL_MEM_LOG_FD=N: the file descriptor the Perl_mem_log_...()