How to use the decomment.getEOL function in decomment

To help you get started, we’ve selected a few decomment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bucharest-gold / szero / lib / reader.js View on Github external
function getFileLines (file) {
  const lines = [];
  let decommented, EOL;
  const strFile = fs.readFileSync(file).toString().replace(/#/g, ' ');
  try {
    EOL = decomment.getEOL(strFile);
    decommented = decomment(strFile);
  } catch (e) {
    console.error(file, e);
    return lines;
  }
  decommented.split(EOL)
    .forEach(line => lines.push(line));
  return lines;
}

decomment

Removes comments from JSON/JavaScript, CSS/HTML, CPP/H, etc.

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis