Socket
Socket
Sign inDemoInstall

electron

Package Overview
Dependencies
Maintainers
5
Versions
1311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron - npm Package Compare versions

Comparing version 0.4.1 to 1.3.1

.travis.yml

7

index.js

@@ -1,3 +0,4 @@

module.exports = process.env.ELECTRON_COV
? require('./lib-cov/electron')
: require('./lib/electron');
var fs = require('fs')
var path = require('path')
module.exports = path.join(__dirname, fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8'))
{
"author": "Jake Luer <jake@alogicalparadox.com>",
"name": "electron",
"description": "A simple command-line interface framework for node.js.",
"keywords": [ "cli", "command", "option", "parser", "argv" ],
"homepage": "http://alogicalparadox.com/electron",
"license": "MIT",
"version": "0.4.1",
"version": "1.3.1",
"description": "Install electron prebuilt binaries for the command-line use using npm",
"repository": {
"type": "git",
"url": "git://github.com/logicalparadox/electron.git"
"url": "git+https://github.com/electron-userland/electron-prebuilt.git"
},
"main": "./index",
"scripts": {
"test": "make test"
"cache-clean": "rm -rf ~/.electron && rm -rf dist",
"postinstall": "node install.js",
"pretest": "npm run cache-clean && node install.js",
"test": "standard && tape test/*.js"
},
"bin": {
"electron": "cli.js"
},
"main": "index.js",
"dependencies": {
"drip": "1.1.x"
"extract-zip": "^1.0.3",
"electron-download": "^2.0.0"
},
"devDependencies": {
"mocha": "*"
, "chai": "*"
, "chai-spies": "*"
"home-path": "^0.1.1",
"path-exists": "^1.0.0",
"standard": "^5.4.1",
"tape": "^3.0.1"
},
"optionalDependencies": {},
"engines": {
"node": "*"
}
"author": "Mathias Buus",
"license": "MIT",
"bugs": {
"url": "https://github.com/electron-userland/electron-prebuilt/issues"
},
"homepage": "https://github.com/electron-userland/electron-prebuilt",
"directories": {
"test": "test"
},
"keywords": []
}

@@ -1,149 +0,86 @@

# Electron [![Build Status](https://secure.travis-ci.org/logicalparadox/electron.png?branch=master)](http://travis-ci.org/logicalparadox/electron)
# electron-prebuilt
> A simple command-line interface framework for [node.js](http://nodejs.org).
[![build status](http://img.shields.io/travis/electron-userland/electron-prebuilt.svg?style=flat)](http://travis-ci.org/electron-userland/electron-prebuilt)
#### Features
[![badge](https://nodei.co/npm/electron-prebuilt.png?downloads=true)](https://www.npmjs.com/package/electron-prebuilt)
- reimagined `process.argv` parsing utility
- framework for single or multiple command programs
- automatic `--help` command generation with multiple theming options
- built in cli coloring
- chainable api
Install [electron](https://github.com/atom/electron) prebuilt binaries for command-line use using npm. This module helps you easily install the `electron` command for use on the command line without having to compile anything.
## Quick Start Guide
Electron is a JavaScript runtime that bundles Node.js and Chromium. You use it similar to the `node` command on the command line for executing JavaScript programs. For more info you can read [this intro blog post](http://maxogden.com/electron-fundamentals.html) or dive into the [Electron documentation](https://github.com/atom/electron/tree/master/docs)
This "Quick Start Guide" and the full API reference can be found
on [electron's documentation website](http://alogicalparadox.com/electron).
## Installation
#### Installation
Download and install the latest build of electron for your OS and add it to your projects `package.json` as a `devDependency`:
The `electron` package is available through [npm](http://npmjs.org). It is recommended
that you add it to your project's `package.json`.
```bash
npm install electron
```
npm install electron-prebuilt --save-dev
```
#### Parsing Arguments
This is the preferred way to use electron, as it doesn't require users to install electron globally.
The argument parsing utility can be used independently of the program
framework. Just pass the `process.argv` from any node modules and your
ready to go.
You can also use the `-g` flag (global) to symlink it into your PATH:
The following command execution...
```bash
$ node cli.js build --minify --out saved.min.js
```
npm install -g electron-prebuilt
```
Could be captured as so...
If that command fails with an `EACCESS` error you may have to run it again with `sudo`:
```javascript
var argv = require('electron').argv();
```
sudo npm install -g electron-prebuilt
```
// objects
argv.commands; // [ 'build' ]
argv.modes; // [ 'minify' ]
argv.params; // { out: 'saved.min.js' }
Now you can just run `electron` to run electron:
// helpers
argv.command('build'); // true
argv.mode('m', 'minify'); // true
argv.param('o', 'out'); // 'saved.min.js'
```
electron
```
Recommend reading the "Argument Parsing Utility" section of the
[documentation](http://alogicalpardox.com/electron)
to learn about the methodologies and specifics of each of the helpers.
If you need to use an HTTP proxy you can [set these environment variables](https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables)
#### Your First Program
If you want to change the architecture that is downloaded (e.g., `ia32` on an `x64` machine), you can use the `--arch` flag with npm install or set the `npm_config_arch` environment variable:
```
npm install --arch=ia32 electron-prebuilt
```
To construct your first program, simply execute the electron export
with a parameter of the namespace you wish to use for your program.
Then proceed to define your settings and commands.
## About
```javascript
var myApp = require('../lib/myapp')
, program = require('electron')('myapp');
Works on Mac, Windows and Linux OSes that Electron supports (e.g. Electron [does not support Windows XP](https://github.com/atom/electron/issues/691)).
/**
* Define your program settings
*/
The version numbers of this module match the version number of the [offical Electron releases](https://github.com/atom/electron/releases), which do not follow [semantic versioning](http://semver.org/).
program
.name('My Cool App')
.desc('http://docs.mycoolapp.com')
.version(myApp.version);
This module is automatically released whenever a new version of Electron is released thanks to [electron-prebuilt-updater](https://github.com/johnmuhl/electron-prebuilt-updater) written by [John Muhl](https://github.com/johnmuhl/).
/**
* Define your first command
*/
## Usage
program
.command('build')
.desc('start a build task')
.option('-m, --minify', 'flag to set enable minification')
.option('-o, --out [file.js]', 'name of output file')
.action(function (argv) {
var minify = argv.mode('m', 'minify')
, savefile = argv.param('o', 'out')
, cwd = argv.cwd;
First you have to [write an electron application](https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md)
program.colorize();
console.log('Welcome to myApp'.gray + myApp.version);
console.log('It works if it ends with '.gray + 'myApp ' + 'ok'.green);
// etc...
});
Then you can run your app using:
/**
* Parse argv and execute respective command
*/
program.parse();
```
electron your-app/
```
Your `-h, --help` and `-v, --version` will be generated for you automatically.
## Related modules
Recommend reading the "Program Framework" and "Constructing Commands" sections
of the [documentation](http://alogicalpardox.com/electron)
to learn about all of the available chainable commands and theming options
available to construct your programs.
- [electron-packager](https://github.com/electron-userland/electron-packager) - package and distribute your electron app in OS executables (.app, .exe etc)
- [electron-builder](https://github.com/loopline-systems/electron-builder) - create installers for Windows and OS X. It's built to work together with electron-packager
- [menubar](https://github.com/maxogden/menubar) - high level way to create menubar desktop applications with electron
## Tests
Find more at the [awesome-electron](https://github.com/sindresorhus/awesome-electron) list
Tests are writting in [Mocha](http://github.com/visionmedia/mocha) using
the [Chai](http://chaijs.com) `should` BDD assertion library. To make sure you
have that installed, clone this repo, install dependacies using `npm install`.
## Programmatic usage
$ npm test
Most people use this from the command line, but if you require `electron-prebuilt` inside your node app it will return the file path to the binary.
Use this to spawn electron from node scripts.
## Contributors
``` js
var electron = require('electron-prebuilt')
var proc = require('child_process')
Interested in contributing? Fork to get started. Contact [@logicalparadox](http://github.com/logicalparadox)
if you are interested in being regular contributor.
// will something similar to print /Users/maf/.../Electron
console.log(electron)
* Jake Luer ([@logicalparadox](http://github.com/logicalparadox))
## License
(The MIT License)
Copyright (c) 2012 Jake Luer <jake@alogicalparadox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
// spawn electron
var child = proc.spawn(electron)
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc