Created
September 11, 2020 03:12
-
-
Save jdiamond/aff2cbba4ea2c7a02189b0fc85235e1f to your computer and use it in GitHub Desktop.
top-level await
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "module" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { exec } from 'child_process'; | |
import { promisify } from 'util'; | |
const execAsync = promisify(exec); | |
const { stdout } = await execAsync('ls -l'); | |
console.log(stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the output: