Skip to content

Instantly share code, notes, and snippets.

@anchnk
Created December 24, 2018 14:01
Show Gist options
  • Save anchnk/29be7fbe08f16c5528e6703eea7f4ac9 to your computer and use it in GitHub Desktop.
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
'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