{"size": 551, "ext": "js", "max_stars_repo_path": "rascunho/nfe-parser/index.js", "max_stars_repo_name": "gusflopes/contabilidade", "max_stars_repo_stars_event_min_datetime": "2020-01-16T03:26:37.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-04T17:35:02.000Z", "max_issues_repo_path": "rascunho/nfe-parser/index.js", "max_issues_repo_name": "gusflopes/contabilidade", "max_issues_repo_issues_event_min_datetime": "2021-05-11T00:27:49.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T00:27:49.000Z", "max_forks_repo_path": "rascunho/nfe-parser/index.js", "max_forks_repo_name": "gusflopes/contabilidade", "max_forks_repo_forks_event_min_datetime": "2020-01-23T01:25:35.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-23T01:25:35.000Z"}
{"max_stars_count": 15, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 22.04, "max_line_length": 70, "alphanum_fraction": 0.5898366606}
/* eslint-disable */
const convert = require('xml-js');
const fs = require('fs');

module.exports = {
  nfeParser: async xmlFile => {
    const xmlfile = fs.readFileSync(
      './rascunho/assets/nfe-example.xml',
      'utf8'
    );
    const options = { compact: true, ignoreComment: true, spaces: 4 };

    const { nfeProc } = await convert.xml2js(xmlfile, options);

    const { NFe } = nfeProc;
    const { ide, emit, dest, det, total, tranp } = NFe;
    console.log(ide);

    return NFe;
  },
  hello: () => {
    return 'Hello World';
  },
};
