Skip to content
/ exec Public

Execute and get the output of a shell or bash command in Deno.

License

Notifications You must be signed in to change notification settings

acathur/exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Exec

Execute and get the output of a shell or bash command in Deno.

Requires the --allow-run flag.

Usage

import { exec } from 'https://cdn.depjs.com/exec/mod.ts'

await exec('deno -V')
// --> deno 1.0.0

await exec(['which', 'deno'])
// --> /usr/local/bin/deno

await exec({
  cmd: ['python', '-c', `import os; print(os.environ['ENV_VAR'])`],
  cwd: './',
  env: {
    ENV_VAR: 'cheers'
  }
})
// --> cheers

License

MIT

Copyright (c) 2020, Acathur