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-ipc-service

v0.0.0

Published

Type-safe Electron IPC functional call

Readme

Make Electron's IPC calls elegant and simple with just function calls. Mostly, enjoying full type-safety! 🎩

Features

  • 🚀 Supertiny — less than 1kB (gzipped)
  • 🧹 Superclean — no dependencies
  • 💪🏻 Full type safety, with all types defined only once

Install

pnpm i electron-ipc-service

Usage

In Main

import { app } from 'electron'
import { initializeIpcServices, IpcService, useIpcContext } from 'electron-ipc-service'

// 1. Define your custom service that extends "IpcService"
class AppService extends IpcService {
  // 1.1. Define a unique "namespace" for each service,
  // all service methods will be available under this namespace.
  static readonly namespace = 'app'

  // 1.2. Implement your custom functions, which can be sync or async,
  // but the results will always be a Promise when called from the renderer.
  getAppVersion() {
    return app.getVersion()
  }

  async search(input: string) {
    // 1.3. Access ipc context with `useIpcContext()` when needed,
    // it's automatically injected via AsyncLocalStorage
    const { sender } = useIpcContext()

    const { promise, resolve } = Promise.withResolvers<Electron.Result | null>()
    let requestId = -1
    sender.once('found-in-page', (_, result) => {
      resolve(result.requestId === requestId ? result : null)
    })
    requestId = sender.findInPage(input)
    return promise
  }
}

// Define other custom services
class UtilService extends IpcService {
  static readonly namespace = 'util'
  bar() {
    return `${UtilService.namespace} - bar`
  }
}

// 2. Initialize ipc services
const ipcServices = initializeIpcServices([AppService, UtilService])

// 2.1. Export the ipc service types for use by the renderer's `createIpcClient`,
// enabling full type safety!
export type IpcServices = typeof ipcServices

In Preload Script

import { initializeIpcBridge } from 'electron-ipc-service/preload'

// 3. Setup the ipc channel bridge to connect the "main"/"renderer" processes
initializeIpcBridge()

In Renderer

import { createIpcClient } from 'electron-ipc-service/renderer'
import type { IpcServices } from '<path_to_your_main_ipc_declaration_file.ts>'

// 4. Setup the ipc client
export const ipc = createIpcClient<IpcServices>()

// Then you can call ipc methods with full type-safety 🎉
await ipc.app.getAppVersion() // => "0.0.1"
await ipc.app.search('foo') // => { matches: ... }
await ipc.util.bar() // => "util - bar"

Thanks

Most of the code is forked from https://github.com/Innei/electron-ipc-decorator/

2025 © Innei, Released under the MIT License. Personal Website · GitHub @Innei

Thanks for all the hard works ❤️

License

❤️ MIT © Kricsleo