electro

2.1.1 • Public • Published

electro

electron and unix make friends

synopsis

This is a simple wrapper around electron that kills boilerplate and allows stdio to work correct. Making electron a better unix citizen!

Example: cat

write stdin or the first file to the dom...

var path = require('path')
var pre = document.createElement('pre')
document.body.appendChild(pre)
 
;( process.stdin.isTTY
  ? require('fs').createReadStream(path.resolve(process.argv[2]))
  : process.stdin
)
.on('data', function (data) {
  pre.innerText += data.toString()
})
.resume()

you'll find this file in ./examples/cat.js

then run it with electro

# read the first file
electro ./examples/cat.js README.md

# OR, use pipes!

electro ./examples/cat.js < README.md

Usage

make sure electron is installed first!

npm install electron-prebuilt -g

electro [electro options] filename {options}

options work the same as in node.js. any options passed before filename are options for chrome or electron. any BrowserWindow option can be set this way.

If no arguments are provided, electro will open a repl (aka, a browser window with devtools)

License

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i electro

    Weekly Downloads

    34

    Version

    2.1.1

    License

    MIT

    Unpacked Size

    8.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • dominictarr