Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs create buffer from string

// a string
const str = "Hey. this is a string!";

// convert string to Buffer
const buff = Buffer.from(str, "utf-8");

console.log(buff); // <Buffer 48 65 79 2e ... 72 69 6e 67 21>
Source by melvingeorge.me #
 
PREVIOUS NEXT
Tagged: #nodejs #create #buffer #string
ADD COMMENT
Topic
Name
1+7 =