Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

url to buffer node.js

const fetch = require("node-fetch");

const getBuffer = async (url) => {
  try {
    const response = await fetch(url);
    const arrayBuffer = await response.arrayBuffer();
    const buffer = Buffer.from(arrayBuffer);
    return buffer;
  } catch (error) {
    return { error };
  }
};
 
PREVIOUS NEXT
Tagged: #url #buffer
ADD COMMENT
Topic
Name
4+5 =