This is available in itk.js:
https://insightsoftwareconsortium.github.io/itk-js/docs/polydata_formats.html