JS module to transform JSON