Fast native implementation in c(++) of a replace string script as an npm package. Replaces a string in a file.
Platform | Status | Notes |
---|---|---|
Linux | ||
MacOS | ||
Windows | Use the precompiled binary available in .bin |
fastreplacestring.exe filename src dest
- filename: filename to read
- src: string that will be replaced
- dest: replacement
echo "let () = print_endline \"Hello world🌍\";" > hello.re
fastreplacestring.exe hello.re world🌍 universe⛄️
cat hello.re
>>> let () = print_endline "Hello universe⛄️";
# everything
npm run test
# default tests
node ./tests/test.js
# cross compiling tests
node ./tests/xtest.js
- clone the repo
- add a new file under
./tests/input/yourFileName
- add the expected file under
./tests/expected/yourFileName
- add a command in
./tests/test.js
of formfilename src dest
, e.g.yourFileName aString aReplacement
- make changes to
fastreplacestring.cpp
&npm run build
npm run test
Fastreplacestring.exe has been cross compiled from a Macbook Pro (13" intel i5 early 2015 macOS Sierra 10.12.5) to the following platforms:
OS | ARCH | Binary | CI available |
---|---|---|---|
Linux | 32 | fastreplacestring-linux32.exe | 🚫 |
64 | fastreplacestring-linux64.exe | ✅ | |
Windows | 32 | fastreplacestring-win32.exe | ✅ |
64 | fastreplacestring-win64.exe | 🚫 | |
Darwin | 32 | fastreplacestring-darwin32.exe | 🚫 |
64 | fastreplacestring-darwin64.exe | ✅ |
All binaries are located in the .bin
directory.