strip-comments

node v14.20.1
version: 2.0.0
endpointsharetweet
const strip = require('strip-comments'); // const file = fs.readFileSync( // path.join(process.cwd(), 'index.js') // ); const file = ` /** * Function to generate the Square of a Number * * @param {Number} x - The number to be squared * @return {Number} Squared value of passed Number */ const square = (x) => { return Math.pow(x, 2) } export default square ` const str = strip(file.toString()); console.log(str);
Loading…

no comments

    sign in to comment