Skip to content
标签
nodejs
字数
43 字
阅读时间
1 分钟

安装

zsh
yarn add node-html-to-image

使用

简单使用

js

nodeHtmlToImage({

output: './image_.png',

html: '<html><body>Hello world!</body></html>'

})

.then((dataUrl) => {

console.log("Image saved!");

})

.catch((error) => {

console.error("Error:", error);

});

撰写