Open a file in code editor from shell
I'm looking for a command that will open a file in the editor tab. If the file does not exist it should create the file.
As we see in VScode "code filename" command.
My main goal is to use the shell instead of the left file explorer provided by repl.it
I couldn't find a command to do so, but I know a program that comes close to it. First do this,
npm init, then
npm i nedb. Second,
const Datastore = require('nedb'); const database = new Datastore('database.db'); database.loadDatabase(); //database.db can be changed but must have .db at the end.
Well, there is no command to do both! But the shell in your repl is bash, which does not have the
code command like Windows. So to create a file do
touch <example.txt> and to open a file do
cd path/to/file/name and you are done!