npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

electron-wincom

v1.0.9

Published

A simple window manager for Electron

Downloads

39

Readme

WinCom

A simple window communication plugin for your Electron application.

Installation

npm i electron-wincom --save


Usage

Can be included like this in the "Main" process:

const winCom = require('electron-wincom');

Can be included like this in the "Renderer" process:

const winCom = require('electron').remote.require('electron-wincom');

Methods

create(name, options)

Creates and returns a BrowserWindow instance which is also added to winCom.list. The options argument is an object that can take all the available options of the BrowserWindow options argument, with some added properties:

  • url - Passes in the URL to BrowserWindowInstance.loadURL() when creating the instance.
  • showDevTools - Open developer tools for the window.

add(name, win)

Takes a name and a BrowserWindow instance and adds it to winCom.list. It will throw if a window with the given name is already in the list. Returns winCom.

remove(name)

Takes a name and removes the BrowserWindow instance from winCom.list. Returns winCom.

replace(name, win)

Replaces a window in winCom.list with the given name. Does NOT throw if the name doesn't exist. Returns winCom.

get(name)

Returns a BrowserWindow instance stored under the given name, otherwise null.

has(name)

Returns true/false whether a BrowserWindow instance with the given name has been added.

getName(win)

Takes a BrowserWindow instance and returns the name it's stored under or null otherwise.

on(evName, callback)

Registers a listener with the given evName and callback. The callback may take one argument which is an object with event data.

off(evName, handler)

Removes the listener for the given evName and handler.

emit(evName, [options])

Emits an event. options is optional and can have any, or all, of these properties:

  • The options.data argument can be of any value.
  • The options.target is a string that is the name of the target window.
  • options.emittedBy is the BrowserWindow instance that's emitting the event. It is used to retrieve the name of the window, and will pass on that name to the recipient.

Events example

// Window 1.

// Require winCom from the main process.
const winCom = require('electron-wincom');

// Create our BrowserWindow instance. You can also use the [winCom.add()] 
// method to add the window if you've already created it.
let win1 = winCom.create('first-window', {
    url: 'the/path/to/the/template/window.html',
    width: 600,
    height: 800
});

// Keep reference to handler to remove it later on.
function handler (event) {
    console.log(event.name); // "my-event"
    console.log(event.data); // "some data"
    console.log(event.target); // "first-window"
    console.log(event.emittedBy); // "second-window"
};

// Registering listener.
winCom.on('my-event', handler);
// Window 2.

// Require winCom from the renderer process.
const winCom = require('electron').remote.require('electron-wincom');

// Create our BrowserWindow instance.
let win2 = winCom.create('second-window', {
    url: 'the/path/to/the/template/window.html',
    width: 400,
    height: 400,
});

// Emit event. Second argument and all data inside it is optional.
winCom.emit('my-event', {
    data: 'some data',
    target: 'first-window',
    emittedBy: win2
});