I want to use node.js to automatically add comments for the designated location, there is no train of thought, ask for advice!

clipboard.png

for example, adding comments on data structures for activities, the crux of the problem is that you don"t know how to write a file at a certain point in the file

Mar.24,2021

be simple and rude and use raplece directly.

arr[i] = arr[i].replace(/activities/g, `// 
activities`);

I don't know what kind of demand it comes from?

simply read the file to the specified column on the specified line and add a comment.
however, there is a problem to consider. If you add a new comment, the following code will all be moved down one line.

Menu