Skip to content

Instantly share code, notes, and snippets.

@simonplend
Last active February 9, 2022 23:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonplend/f74b784c94817e0df85fadf631326ef1 to your computer and use it in GitHub Desktop.
Save simonplend/f74b784c94817e0df85fadf631326ef1 to your computer and use it in GitHub Desktop.
Node.js v17.5.0 nightly build test - see instructions.sh
{
"url": "https://jsonplaceholder.typicode.com/todos/1"
}
# Download v17.5.0 nightly build for Linux x64
#
# If you're on a Mac, replace `linux-x64.tar.gz` with:
#
# - Apple M1 Mac - darwin-arm64.tar.gz
# - Intel-based Mac - darwin-x64.tar.gz
curl -O https://nodejs.org/download/nightly/v17.5.0-nightly20220209e43808936a/node-v17.5.0-nightly20220209e43808936a-linux-x64.tar.gz
# Extract the build
tar xzvf node-v17.5.0-nightly20220209e43808936a-linux-x64.tar.gz
# Download the test script and JSON config file
curl -O https://gist.githubusercontent.com/simonplend/f74b784c94817e0df85fadf631326ef1/raw/8520db97bff2b5d4b208830fc5d2414af7c6de59/test.mjs
curl -O https://gist.githubusercontent.com/simonplend/f74b784c94817e0df85fadf631326ef1/raw/8520db97bff2b5d4b208830fc5d2414af7c6de59/config.json
# Run the test script with Node.js v17.5.0 nightly build
node-v17.5.0-nightly20220209e43808936a-linux-x64/bin/node --experimental-fetch test.mjs
(node:305617) ExperimentalWarning: Fetch is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:305617) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
{ userId: 1, id: 1, title: 'delectus aut autem', completed: false }
(node:305617) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
import config from "./config.json" assert { type: "json" };
const response = await fetch(config.url);
const json = await response.json();
console.log(json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment