Created
February 6, 2012 20:44
-
-
Save solarsailer/1754721 to your computer and use it in GitHub Desktop.
Simple doc parser
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
fs = require 'fs' | |
path = 'some_path.js' | |
fs.readFile path, 'utf-8', (err, data) -> | |
data.split('\n').forEach (line) -> | |
if line.indexOf('*') != -1 | |
line = clean line | |
console.log line if line != '' | |
clean = (line) -> | |
line = line.replace('/*', '') | |
line = line.replace('/**', '') | |
line = line.replace('*/', '') | |
line = line.replace('*', '') | |
line = line.trim() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment