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:
redis@4.6.15
@quicknode/sdk@2.3.0
ethers@6.13.1
web3@4.10.0
@solana/web3.js@1.95.3
axios@1.7.2
date-fns@3.6.0
dotenv@16.4.5
lodash@4.17.21
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
};
}