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

cra-template-electron-react-ts

v1.0.3

Published

This template is for a basic electron application that uses typescript with a React-based renderer.

Downloads

8

Readme

Electron with React and Typescript Template

This template is for a basic electron application that uses typescript with a React-based renderer.

The motivation for making this template is to provide a starter electron app the correct, safe way. I have found that other templates still use javascript for the main process code, or turn on nodeIntegration in the renderer, which can be unsafe. I also wanted a basic custom title bar for the window rendered by React, instead of the ugly default Windows title bar.

nodeIntegration is turned OFF, which is the safe default recommended by electron

This template targets Windows for builds, since that is what I will be making desktop apps for. No plans to support other platforms yet.

Modifications

  • A tsconfig.electron.json was added to handle compiling electron code written in typescript. This will compile everything from the src/main directory into an electron directory
  • Included are the standard Windows title bar icons as React components, and a draggable title bar is added to the top of the frameless window
    • This title bar uses IPC to communicate with the main process to handle maximize/minimize/restore/close, as well as detect when the user has maximized/restored
  • The preload script has type definitions for the IPC api, so that the api object attached to the window object has types
  • The contextBrige API is used for IPC with the main process instead of exposing native node modules to the renderer, such as fs
    • Only the main process has access to native apis directly, so their use can be tightly controlled
  • the index.html file and public folder is stripped down

Scripts

  • start
    • Run to start the dev server, with hot reload for the renderer code. No hot-reloading for the main process yet.
  • build
    • Run to package the app for windows

Electron Tips

  • The new assets folder can contain the app icon. Put a file named icon.png that is at least 512x512 in this folder to use it as the app icon when packaged
    • note that the default electron icon is still used in dev mode
  • In package.json, edit the build.appId and build.productName to contain the name of your app. The productName entry will be the name of the executable and the app in the start menu.
  • Add author and description entries to package.json.