If you need a JS library for json to json transformation, check out mappingutils, which I recently wrote. It supports JSONPath syntax for easy mapping. For a more mature alternative, you might also explore jsonata.
mappingutils
jsonata