Skip to main content

Node.js 20 Runtime

Updated on
Nov 15, 2024

Overview

The Node.js v20 Runtime enables you to build and deploy serverless functions using the Node.js v20 environment. This runtime provides access to the QuickNode SDK, popular packages and web3 libraries, as well as the Node.js core modules.

Available Packages

The Node.js 20 runtime includes the following useful packages and web3 libraries which can be used inside your function:


  • @aws-sdk/client-sqs@3.678.0
  • @azure/service-bus@7.9.5
  • @azure/storage-blob@12.25.0
  • @coral-xyz/anchor@0.30.1
  • @quicknode/sdk@2.3.0
  • @solana/spl-token@0.4.9
  • @solana/web3.js@1.95.4
  • axios@1.7.7
  • bn.js@5.2.1
  • date-fns@3.6.0
  • ethers@6.13.1
  • kafkajs@2.2.4
  • lodash@4.17.21
  • redis@4.7.0
  • twitter-api-v2@1.18.2
  • web3@4.10.0

The Node.js v20 runtime also includes the following core modules:


  • assert
  • buffer
  • child_process
  • cluster
  • console
  • crypto
  • dgram
  • dns
  • events
  • fs
  • http
  • https
  • net
  • os
  • path
  • process
  • querystring
  • readline
  • stream
  • string_decoder
  • tls
  • tty
  • url
  • util
  • v8
  • vm
  • zlib

For more details, you can refer to the Node.js GitHub repository.

Using the Code Editor

Within the code editor, you can write and test your function using the core modules listed above. Here is a simple example of a Node.js function:


function main(params) {
// Extract dataset and network from metadata in params
const dataset = params.metadata.dataset;
const network = params.metadata.network;

return {
message: `This is data from the ${dataset} dataset on the ${network} network.`,
params
};
}

Share this doc