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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fwgui

v1.2.4

Published

This library is a liteweight React Electron alternative, it's small and easy to use. It uses system installed Chromium as frontend engine, so the distribution won't take much disk space too.

Downloads

13

Readme

FWGUI (NPM)

Source of inspiration (Python "implementation")

This library is a liteweight React Electron cross-platform alternative, small and easy to use. It uses system installed Chromium as frontend engine, so the distribution won't take much disk space (while Electron's will). You can pack it with nexe or whatever (F0Talk is an example).

Unlike its "older brother", the library just starts a Chromium instance with your web page opened, and provides message excanging with the frontend through JS functions, that are exposed from server to client and vice versa. Like:

Instead of

FWGUI.send('anAction', ['data'])

We just use (though serverside's still able to emit events)

FWGUI.anAction(['data'])

An example (my project), slightly outdated: F0Talk

Installation

pnpm add fwgui

or

yarn add fwgui

or

npm i fwgui

Example

index.js

const FWGUI = require('fwgui');
const RELEASE = true;

const SVLog = text => console.log(`Log: ${text}`);

(async () => {
    if (!await FWGUI.start({
        webdir: 'wgui',
        serverPort: 8889,
        clientPort: RELEASE ? 8889 : 8080,
    }))
        console.log('Failed to open GUI');
    await FWGUI.expose(SVLog);
    await FWGUI.endExpose();
    FWGUI.emit('time to print', 'text');
    FWGUI.Alert('Message!');
})();

wgui/index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="fwgui_cl.js"></script>
    <script>
        (async () => {
            fwgui.expose('Alert', text => alert(text));
            fwgui.on('time to print', text => fwgui.SVLog(text));
            await fwgui.exposeEnd();
            fwgui.SVLog('Functions are now certainly ready, so we can use them with ease');
        })();
    </script>
</head>
</html>
  • Don't forget to include the clientside script fwgui_cl.js in your HTML file.
  • When using separate frontend server, the clientside lib (node_modules/fwgui/frontend/fwgui_cl.js) is basically unavaliable. Solutions:
    1. Put the file directly in your HTML folder
    2. Create a symlink
    3. Enter full path to the script (host + port)
    4. ...