abyss.7
abyss.7

Reputation: 14462

How to execute native binaries from Atom Package?

I want to write the package, that have to run a program inside - with arguments. It's better to be cross-platform, but the Linux-only solution is good enough.

How to do that in Atom Editor?

Upvotes: 0

Views: 125

Answers (1)

Dmytro Sadovnychyi
Dmytro Sadovnychyi

Reputation: 6201

Use BufferedProcess to spawn any binary you want.

{BufferedProcess} = require 'atom'

command = 'ps'
args = ['-ef']
stdout = (output) -> console.log(output)
exit = (code) -> console.log("ps -ef exited with #{code}")
process = new BufferedProcess({command, args, stdout, exit})

Upvotes: 1

Related Questions