Created
December 24, 2018 14:01
-
-
Save anchnk/29be7fbe08f16c5528e6703eea7f4ac9 to your computer and use it in GitHub Desktop.
A simple JS function with an npm dependency I am trying to test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const neatCsv = require('neat-csv'); | |
async function parseResponseToJson(apiResponse) { | |
try { | |
const result = await neatCsv(apiResponse.body, { | |
separator: ';' | |
}); | |
return result; | |
} catch (parseError) { | |
throw parseError; | |
} | |
} | |
module.exports = { | |
parseResponseToJson | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment