Find all files with the extension .js in the current directory and its subdirectories, and replace all occurrences of the word 'foo' with the word 'bar' in those files.
find ./ -name '*.js' | xargs sed -i -e 's/foo/bar/g'