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-launch-page

v1.0.2

Published

让你可以自定义启动页,用来优雅的加载展示你的 electron 应用。

Readme

electron-launch-page

让你可以自定义启动页,用来优雅的加载展示你的 electron 应用。

Demo

/demo 文件夹下包含一个完整的使用 electron-launch-page 的示例。

launch1.html: 不透明loading avatar

launch2.html: 不透明loading,使用进度 avatar

launch3.html: 透明的loading avatar

Installation

npm install electron-launch-page

Usage

主进程:

const Elp = require('electron-launch-page');
Elp.main.start({
    //主窗口 BrowserWindow
    mainWin,
    //自定义的启动页
    launchUrl: path/to/your-launch.html,
    //启动窗口大小,根据 your-launch.html 配置
    width: 480,
    height: 320
});

渲染进程中涉及2个页面:

  1. 在自定义的启动页里,如果需要加进度条的交互,参考如下代码:

     const Elp = require('electron-launch-page');
     Elp.render.launch({
         onProgress(progress) {
             processBar.style.width = progress + '%';
         }
     });

    如果启动页只展示 loading 效果,则可以不用添加与 electron-launch-page 相关的代码。

  2. 在应用的主页里,当页面资源加载完成调用 Elp.render.ready()

     const Elp = require('electron-launch-page');
     //模拟页面加载耗时2秒
     setTimeout(()=> {
         Elp.render.ready();
     }, 2000);

Method & Options

Elp.main.start(options)

  • mainWin [必须]

    Object: 主窗口 BrowserWindow

    在使用 electron-launch-page 的时候,创建 mainWin 应该启动参数 show: false

  • launchUrl [必须]

    String: 自定义启动页面路径 file path

  • transparent [可选]

    Boolean: 是否启动透明窗口,用法同 BrowserWindow 的 transparent

  • width [可选]

    Number: 启动窗口的宽度

  • height [可选]

    Number: 启动窗口的高度

Elp.render.launch(options)

  • onProgress(progress) [可选]

    Function: 启动进度,progress 是 0~100 数值

  • speed [可选]

    String: 'slow'|'normal'[默认]|'fast' 可结合实际情况选用

当你的启动界面不需要进度条交互时,Elp.render.launch() 可不传参数。

Elp.render.ready()

用于主窗口资源(本地、远程)加载完成,页面可完全展示时调用。