Comments (5)
can these command line args be passes to an electron apps .exe windows version of the app
like:
my-electronjs-app.exe -args
from electron-prebuilt.
The renderer process can access the main process argv like so:
require('electron').remote.process.argv
from electron-prebuilt.
You just pass then after your script file
// save as test.js
console.log(process.argv)
and then
npm install -g electron-prebuilt
electron test.js hello world
from electron-prebuilt.
Thanks for the quick response.
I have tried this but getting always this result
["C:\Users\Stephan\AppData\Roaming\npm\node_modules\electron-prebuilt\dist\electron.exe", "--type=renderer", "--no-sandbox", "--enable-deferred-image-decoding", "--lang=de", "--node-integration=true", "--device-scale-factor=1", "--font-cache-shared-mem-suffix=2764", "--enable-pinch-virtual-viewport", "--enable-delegated-renderer", "--num-raster-threads=1", "--channel=2764.8.56440853\521306387", "/prefetch:673131151"]
Here is my code
var electron = require('electron-prebuilt')
var proc = require('child_process')
// will something similar to print /Users/maf/.../Electron
console.log(electron)
// spawn electron
var child = proc.spawn(electron, ["./app", "foo=bar"]);
from electron-prebuilt.
I just figured out that it works for me if I hold a copy of process.argv
in process.env
process.env.XXXargv = JSON.stringify(process.argv) ;
from electron-prebuilt.
Related Issues (20)
- OpenBSD as a supportet platform? HOT 2
- Unable to install Electron with the quick-start tutorial HOT 7
- "sudo npm install -g electron" fails HOT 1
- Electron not installing (Windows 10) HOT 2
- Got stuck after npm install -g HOT 1
- Error while installing npm in windows 10 HOT 1
- Mac: Failed at the [email protected] postinstall script 'node install.js'. HOT 4
- npm install hangs HOT 3
- Dependency to @types/node makes electron package incompatible with typescript projects not using commonjs HOT 11
- Can't install electron 1.7.1 locally using npm 5 HOT 10
- Install on Bash on Ubuntu on Windows (WSL) HOT 13
- Postinstall script failing HOT 22
- Error: Generated checksum for "electron-v1.4.13-linux-x64.zip" did not match expected checksum. HOT 11
- Prebuilt electron package for Ubuntu 10.04 32 bits HOT 1
- node (vs. nodejs) is required when installing electron HOT 5
- Can't install in Windows10 HOT 1
- Change electron binary path via environment variable? HOT 2
- Electron not installing on Mac Os High Sierra HOT 1
- npm ERR! [email protected] postinstall
- Error while installing electron on Mac
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-prebuilt.