编辑代码

  
 
let str="你好 JSRUN!   \n\n         - from NodeJS .";
let bytes=Buffer.from(str) ;

console.log("bytes:",JSON.stringify(bytes) );

console.log(  bytes.toString("utf8"));