I hope this fits in here (I guess it would also be a match for Stack Overflow, since I'm using a nodeJS module) but basically I'm trying to add // @ts-nocheck \n to the beginning of every file with the .ts file extension.
I'm using ShellJS which, unfortunately, does not appear to support line addressing as per this GitHub issue.
Since sed -i 1i is not supported, what would be a good alternative?
Note that awk is also not available inside ShellJS.
grep, cat, head, tail, sort, echo and uniq are the only available text manipulation commands.
printf? Onlyecho? And do you want a literal\nthere or do you want an actual newline?