DEV Community

Utsav Ladani
Utsav Ladani

Posted on

1 1

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. πŸ˜„

How?

// 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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
utsavladani profile image
Utsav Ladani β€’

If you have any suggestions, then write here.

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay