Simple way to replace all occurences of a string in a file in nodejs

Currently i'm using sed from shelljs. However, it only replaces the first occurrence, and has to be rerun to replace every occurrence in the file. This is the line i'm using:
shell.sed '-i', '{mountPoint}', mountPoint, /tmp/somefile

Is there a way to get this working with shelljs, or some other simple way to perform search and replace?

Thanks

In your current SED command, you have the input and output in two different strings. Another way to arrange this allows you to put the match and replace patterns in the same string as seen below

s/{(.*)}/$1/g

It is broken down as follows

s/    #this is a search and replace
\{    #bracket is escaped since it means something special in REGEX language
(     #keep what is inside the parenthesis for later (kept in $1)
.*    #match anything 
)     
\}    #other bracket you don't want to keep
/     #indicates you are now working on the replace pattern
$1    # what was captured in previous parenthesis
/     #end replace pattern
g     #Global replace

have you tried using g in your replace pattern? http://www.grymoire.com/Unix/Sed.html#uh-6