Function Parameters with Node.js Promise

I'm using blockexplorer API for blockchain, and I want to get block data based on specific hash (This hash should be taken from another function).

I'm new with using Promise, So can anyone help me to get the block data?

This is my code:

const be = require('blockexplorer');

.then((result) => {
.catch((err) => {
throw err

Also, I’ve tried another way with using nested Promise but it didn’t work.

#javascript #node-js #blockchain

3.45 GEEK