electron
Advanced tools
Comparing version 0.4.1 to 1.3.1
@@ -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": [] | ||
} |
163
README.md
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
0
0
8718
2
4
11
63
87
1
5
3
+ Addedelectron-download@^2.0.0
+ Addedextract-zip@^1.0.3
+ Addedajv@6.12.6(transitive)
+ Addedarray-find-index@1.0.2(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbuffer-crc32@0.2.13(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedelectron-download@2.2.1(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextract-zip@1.7.0(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfd-slicer@1.1.0(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@6.0.4(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhome-path@1.0.7(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedisarray@0.0.11.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addedmv@2.1.1(transitive)
+ Addedncp@2.0.0(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednugget@1.6.2(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-keys@0.4.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@1.0.02.1.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpend@1.2.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedpretty-bytes@1.0.4(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprogress-stream@1.2.0(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedreadable-stream@1.1.142.3.8(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedrimraf@2.4.5(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsingle-line-log@0.4.1(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedspeedometer@0.1.4(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedthrottleit@0.0.2(transitive)
+ Addedthrough2@0.2.3(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedxtend@2.1.2(transitive)
+ Addedyauzl@2.10.0(transitive)
- Removeddrip@1.1.x
- Removeddrip@1.1.0(transitive)
- Removedtea-concat@0.1.0(transitive)