It has been ported already.
https://www.npmjs.com/package/css-layout
Oddly enough there's no git repository. Only the npm package has the pure JS code. And the last release was from last year. Fortunately it looks it was easy to port, if one needs a more recent version.