From cfb01fe498d00fa97736496d2b609feac9c9f896 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Mon, 15 Apr 2024 14:33:20 +0200 Subject: [PATCH] Fix node.js readme example --- bindings/nodejs/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bindings/nodejs/README.md b/bindings/nodejs/README.md index 495ad78876..aeaee9c222 100644 --- a/bindings/nodejs/README.md +++ b/bindings/nodejs/README.md @@ -76,19 +76,17 @@ calling [`Client.getInfo()`](https://wiki.iota.org/shimmer/iota-sdk/references/n and then print the node's information. ```javascript -const { Client, initLogger } = require('@iota/sdk'); +import { Client } from '@iota/sdk'; +// In this example we will get information about the node async function run() { - initLogger(); - const client = new Client({ nodes: ['https://api.testnet.shimmer.network'], - localPow: true, }); try { - const nodeInfo = await client.getInfo(); - console.log('Node info: ', nodeInfo); + const nodeInfo = (await client.getInfo()).nodeInfo; + console.log(nodeInfo); } catch (error) { console.error('Error: ', error); }