The library published on npm works only on the client-side. Support for the pigmnts library on server-side using Node.js can be implemented considering following points:
pigments_node() function can be implemented that is compatible with Node.js and does not depend on Browser APIs like canvas.
The existing pigments() function may depend on pigmnts_node() function making it easier to interact with the library on the client-side by abstracting canvas APIs.
Appropriate build system to create a single isomorphic package. wasm-pack supports multiple outputs targets, but combining them under a single package is a little messy. Hoping for this to be merged https://github.com/rustwasm/wasm-pack/pull/705
The library published on npm works only on the client-side. Support for the pigmnts library on server-side using Node.js can be implemented considering following points:
pigments_node()
function can be implemented that is compatible with Node.js and does not depend on Browser APIs like canvas.pigments()
function may depend onpigmnts_node()
function making it easier to interact with the library on the client-side by abstracting canvas APIs.wasm-pack
supports multiple outputs targets, but combining them under a single package is a little messy. Hoping for this to be merged https://github.com/rustwasm/wasm-pack/pull/705