v1.1.0
Added
-
feat: implement
renderAsync()function. By @BrooooooklynWe have made a major upgrade to napi-rs, from v1 to 2.x alpha. This allows better support for asynchronous binding and automatic generation of TypeScript definitions. Now you can enjoy
async/await.The
allocatoris also enabled, which gives a small performanceh boost.const { renderAsync } = require('@resvg/resvg-js') async function main() { const pngData = await renderAsync(/* SVG string or buffer */) }
-
feat: The input to the
render()andrenderAsync()functions supports buffer. -
feat: improved webpack support, no more need
@node-rs/helperdependency.The
@node-rs/helperis convenient to load native binary cross platform and cpu arch. But it's not friendly towebpack,vercel/nftandvercel/nccbecause the logic is too dynamic. -
feat: add
example/compare.js.
Changed
- fix: the default font no longer throws an error if it is not found, it changes to a warning.
- chore: benchmark adds tests for svg icons and other improvements.
- chore: upgrade Rust Edition to 2021.