a pure javascript library for node.js is published. “icoimagejs”
it converts a 32 bit RGBA raw image structure to ico image format
https://www.npmjs.com/package/icoimagejs
I have coded for my free online photo editor project. that it will convert any image to ico format.