d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Javascript Task: Extract Comments From Js Files > 100 Fg
Add Reply New Topic New Poll
Member
Posts: 14,925
Joined: Jan 3 2008
Gold: 135,879.75
Dec 8 2019 10:19am
Given a directory of javascript files:

1. Extract all comments contained within /* */ and stream them into a new "comments.txt" file.
2. Delete the comment portion from the original file.
3. Use any libraries you like.

Example
_________________________________
**abc.js:**

log('hi') //hi

/* random comments to be extracted */

/* random comments to be extracted */

/* random comments to be extracted */
_________________________________

**Output abc.js:**

log('hi') //hi
_________________________________

**Output comments.txt:**

random comments to be extracted
random comments to be extracted
random comments to be extracted
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll