DEV Community

Utsav Ladani
Utsav Ladani

Posted on

When you run command via child_process module you can't able to use cd command, but here I found a way to do that

Hey people,
In my old post, I mentioned a issue . And cause of that issue we couldn't move from one dir to other dir. If we can't change our Current Working Directory, then it is a huge issue and our some task became difficult. But I find a way to do that.

I make one more input box, where you can write your Current Working Directory path and all are working fine. 😄


// code ...

const options = {
    cwd: location, // Here location is your Current Working Directory(cwd)'s path

exec(command, options, (err, stdout, stderr) => {
    if (err) {

//code ...
Enter fullscreen mode Exit fullscreen mode

So using this web app you can make another web app in your server, but still you haven't any text editor to edit those files.

Next features:

  • Simple text editor to edit text file
  • Improve I/O and O/P experience
  • and more...

Write your suggestions in comment 😄
For better understanding, here is the link of my github project

GitHub logo Utsav-Ladani / Html-and-Terminal

Type command in browser and run on server

Discussion (1)

utsavladani profile image
Utsav Ladani Author

If you have any suggestions, then write here.