src/utils/skynet-ops.js
// Reads file content from a given skylink and returns it's data object.
Reads file content from a given skylink and returns it's data object.
Reads file content from a given skylink and returns it ' s data object .
async function readFileContentFromSkylink(skylink) {
    try {
        const {data} = await skynetClient.getFileContent(skylink);
        console.debug(`Reading file content from skylink:\n\tskylink=${skylink}\n\t->res=${JSON.stringify(data)}`);
        return data;
    } catch (e) {
        console.error(`Error reading file content: ${e.message}`);
    }
}
async function readFileContentFromSkylink ( skylink ) { try { const { data } = await skynetClient . getFileContent ( skylink ) ; console . debug ( ` \n \t ${ skylink } \n \t ${ JSON . stringify ( data ) } ` ) ; return data ; } catch ( e ) { console . error ( ` ${ e . message } ` ) ; } }
Reads file content from a given skylink and returns it's data object.
Reads file content from a given skylink and returns it ' s data object .