3

In Python Script, I can simply make it like this:

import os import asyncio async def do_something(): os.system("pip list") asyncio.run(do_something()) 

But what about on JavaScript/NodeJS? I see one module named 'os' too in there, but how do I use it?

1

1 Answer 1

2

You can use the child_process library to run bash commands. Example below.

import { exec } from "child_process"; exec("pip list", (error, stdout, stderr) => { console.log(stdout); }) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.