canvas
canvas copied to clipboard
Example usage with fabric.js or Konva.
Both libs depend on node-canvas how can we use @napi-rs/canvas as a replacement for node-canvas?
I think this should be in discussions tab 😐
I need to pass the integration tests in fabric / Konva first, I don't have time to do this right now
Is it possible to make @napi-rs/canvas to have the same API as node-canvas? If that possible I would like to create an adapter just for that and then alias that in package.json.
I'm trying to swap in @n-api/canvas with webpack
new NormalModuleReplacementPlugin(/(?<!@n-api.)canvas/, "@napi-rs/canvas"),
But am not best with regex and so it's recursing and giving this error
ERROR in ./node_modules/@napi-rs/canvas/index.js Module build failed: Error: ENOENT: no such file or directory, open '/fm4/node_modules/@napi-rs/canvas/@napi-rs/canvas'
-- I like @seanghay 's idea to match the API !!
(I wish it's weren't too late to change the module name...)