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

clickgo-native

v2.0.7

Published

The software developed with ClickGo will run in Windows, Mac OS, Linux.

Readme

ClickGo Native

The software developed with ClickGo will run in Windows, Mac OS, Linux.

Installation

You can install directly using NPM:

$ npm i clickgo-native --save

Node

import * as native from 'clickgo-native';
class Boot extends native.AbstractBoot {
    public onOpenFiles(paths: string[]): void {
        console.log(paths);
    }

    public main(): void {
        this.run(native.path(import.meta.url, './index.html'), {
            'frame': false,
            'icon': native.path(import.meta.url, './logo.png'),
        });
    }
}
native.launcher(new Boot(), {
    'openFiles': true,
    'singleInstance': true,
});

launcher() configures process-level behavior before Electron becomes ready. openFiles forwards files received from associations, command-line launches, and window drops to onOpenFiles(). singleInstance prevents duplicate application processes and activates the existing window when another instance starts. These options are independent; use either one without enabling the other when appropriate.

icon supplies the native window icon on Windows and Linux. Include this file in the application's packaged files; build.linux.icon configures the installed application-list icon separately. When packaging through ClickGo Compiler, set build.linux.icon to a single square PNG of at least 256×256 pixels (512×512 or 1024×1024 is recommended). The compiler automatically generates standard Linux icon sizes in a temporary directory and cleans them up after packaging; the source image and configuration are not changed. Existing multi-size PNG directories remain supported. Also set the application's desktopName and build.linux.syncDesktopName: true to associate the running window with its desktop entry.

For frameless ClickGo applications, the first Form synchronizes its minWidth and minHeight to the native window, including subsequent changes. System close requests (such as Alt+F4) are forwarded to that Form's close event. Call event.preventDefault() synchronously before showing an asynchronous ClickGo confirmation, then close the Form after confirmation. Explicit native.close() and native.quit() are final, authorized close actions and do not repeat the confirmation. These integrations require the corresponding updated ClickGo runtime as well as ClickGo Native.

Build a ClickGo Application as a Native Package

The application project does not need to install electron directly when using ClickGo Compiler to run and package it. The compiler supplies the Electron runtime. Native main-process code can use native.getAppVersion() to read the application's package.json version and native.isPackaged() to distinguish a packaged application from development runs. These APIs do not expose Electron to the HTML page.

Building a desktop application consists of two steps: compile the ClickGo application into a .cga file, then package the Native project with Electron.

Install the compiler globally first:

$ npm i -g clickgo-compiler

Use the following layout as a starting point. The dist/test directory in this repository is a complete working example.

package.json
tsconfig.json
dist/
  index.ts
  index.html
  browser.ts
  app/
    app.ts
    config.json
    form/

The project package.json must use the compiled Native entry as main:

{
    "type": "module",
    "main": "dist/index.js"
}

The Native page must provide the ClickGo runtime and load the compiled browser entry:

<script type="importmap">
{
    "imports": {
        "clickgo": "https://js.maiyun.net/npm/[email protected]/dist/index.js"
    }
}
</script>
<script type="module" src="browser.js"></script>

Compile the ClickGo application source into dist/app.cga:

$ npx tsc
$ clickgo --app ./dist/app --save ./dist/app

Load the generated application from the browser entry:

import * as clickgo from 'clickgo';

class Boot extends clickgo.AbstractBoot {
    public async main(): Promise<void> {
        const taskId = await clickgo.task.run(this._sysId, 'app.cga', {
            'permissions': ['root'],
        });
        if (typeof taskId !== 'string') {
            throw new Error(`Load application failed (${taskId}).`);
        }
    }
}

await clickgo.launcher(new Boot());

Run the Native project without generating an installer:

$ clickgo --run ./dist/index.js

Run the following command from the directory containing package.json to generate a distributable package:

$ clickgo --native --platform win
$ clickgo --native --platform linux
$ clickgo --native --platform mac

When building the Linux rpm target, ensure that rpmbuild is installed on the build host. On Ubuntu or Debian, install it before packaging:

$ sudo apt install rpm

On other Linux distributions, use the system package manager to install the package that provides rpmbuild. This tool is required for RPM packaging, not for the AppImage or DEB targets.

When downloading Electron in mainland China, enable the mirror:

$ clickgo --native --platform win --mirror cn

clickgo --app generates the ClickGo .cga application, clickgo --run only starts the Native project for testing, and clickgo --native invokes Electron Builder to generate the desktop distribution. Build on the target operating system when platform-specific signing or installer tooling is required.

Demo

Clone, build the current ClickGo test application, and run it with Electron:

$ npm i -g clickgo-compiler
$ npm run build
$ npm run native

License

This library is published under Apache-2.0 license.