Runs ~/.config/okrc.k on startup of repl.js if it exists (otherwise it is ignored). This was prompted by me recently experimenting with K5 using oK, and then wanting to save some utility functions for re-use later. I could put them in a file and just copy-paste as necessary, but it would be even nicer if I could put them in a file that gets sourced automatically on REPL startup.
Runs ~/.config/okrc.k on startup of repl.js if it exists (otherwise it is ignored). This was prompted by me recently experimenting with K5 using oK, and then wanting to save some utility functions for re-use later. I could put them in a file and just copy-paste as necessary, but it would be even nicer if I could put them in a file that gets sourced automatically on REPL startup.
The reliance on exception handling to see if the file exists is a bit.. crude and ugly to me, but it seems to be the recommended approach: https://nodejs.org/api/fs.html#fs_fs_exists_path_callback