Socket
Book a DemoInstallSign in
Socket

electron-go-picnic

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-go-picnic

Tools for using Go programs inside Electron apps

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

electron-go-picnic

Package that contains tools for using Go programs with Electron.

Originally extracted from my Who's Hacking product, which used my program gitmonitor to monitor live git repo changes across the system.

Functions

  • getAppPath, which gets the app path in development and production (when the app is unpacked from the archive).
  • getExecutableName which finds the correct executable for OS and CPU arch.
  • getGOARCH and getGOOS, which are used above.

Usage

  • Cross-compile your Go programs for all platforms at once (Windows/Linux/macOS) using go-crosscompile.sh.
  • Copy them to a directory in your Electron app. I advise vendor/.
  • Make sure your executable is unpacked in production so it can be run. E.g. with electron-builder, modify package.json in the "build" section and add:
        "asarUnpack": [
            "vendor/"
        ]
    
  • Then in your Electron code:
const spawn = require('child_process').spawn;
import { getAppPath, getExecutableName } from 'electron-go-picnic';

let cmd = path.join(getAppPath(), `/vendor/', getExecutableName('gitmon'));
spawn(cmd)

Keywords

electron

FAQs

Package last updated on 28 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.