ele

electro

electron and unix make friends

Showing:

Popularity

Downloads/wk

25

GitHub Stars

49

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

2

Size (min+gzip)

2.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100