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

@flownet/lib-to-electron

v0.3.6

Published

This project provides a set of scripts to help you convert your existing Flownet applications into Electron applications seamlessly. By utilizing this project, developers can package their applications as desktop applications using Electron, allowing them

Downloads

215

Readme

@flownet/lib-to-electron

This project provides a set of scripts to help you convert your existing Flownet applications into Electron applications seamlessly. By utilizing this project, developers can package their applications as desktop applications using Electron, allowing them to reach a wider audience beyond the web.

How It Works

The project works by taking your existing Flownet-based web application and preparing it to be packaged as an Electron application. It automates the process of templating, copying necessary files, and setting up the required project directory structure. After setting up, it installs dependencies and builds the application, making it ready for distribution as a desktop application.

Key Features

  • Automatic Templating: Configures your project with a predefined Electron template to ensure consistency and reliability in the setup process.
  • Directory Setup: Automatically creates and cleans necessary directories to avoid conflicts and ensure a smooth packaging process.
  • Dependency Management: Handles the installation of required dependencies specific to the Electron environment.
  • Build Automation: Automates the execution of build scripts to compile the project into an Electron-compatible format.

Conclusion

This utility provides a straightforward way for developers using Flownet to transition their applications into the Electron environment. It simplifies the process of setting up an Electron project, allowing more focus on the development and less on the configuration and setup.

@flownet/lib-to-electron Developer Guide

Overview

The @flownet/lib-to-electron library is designed to streamline the process of building Electron applications. It provides utility functions to set up necessary directories, manage templates, and automate the build process by integrating with shell commands. This library helps developers quickly scaffold and package their Electron apps.

Installation

To add @flownet/lib-to-electron to your project, use npm or yarn:

npm install @flownet/lib-to-electron

Or, if you prefer yarn:

yarn add @flownet/lib-to-electron

Usage

The primary function exported by this library is an asynchronous index function, which you can integrate into your Electron app setup script. This function helps to configure your application’s directories and build processes based on specified parameters.

Real-World Usage Example

Below is a step-by-step example showing how to use the index function in a typical Electron application setup:

  1. Import the library:

    import index from '@flownet/lib-to-electron';
  2. Define the necessary parameters for your project:

    const params = {
      name: "myElectronApp",
      entry: "app/electron",
      id: "com.example.electron",
      version: "1.0.0",
    };
    
    const config = {}; // Add your configuration options if needed
    const src = './src'; // Source directory for your app
    const dest = './build'; // Destination directory for the build
  3. Use the index function:

    async function setup() {
      try {
        await index({ params, config, src, dest });
        console.log('Electron app successfully set up!');
      } catch (error) {
        console.error('Error setting up Electron app:', error);
      }
    }
    
    setup();
  4. Run your setup script to scaffold and build your Electron application.

Examples

Here are some concise code examples to illustrate core functionalities:

Setting Up an Electron Application

import index from '@flownet/lib-to-electron';

const params = {
  name: "myApp",
  entry: "app/main",
  id: "com.example.myapp",
  version: "1.0.0",
};
const src = './source';
const dest = './output';

(async () => {
  try {
    await index({ params, src, dest });
  } catch (error) {
    console.error('Setup failed:', error);
  }
})();

This example demonstrates how to use the index function to prepare an Electron application with specified parameters, source, and destination directories.

Acknowledgements

Special thanks to contributors and any other libraries that indirectly supported the development of this library.

Input Schema

$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
  params:
    type: object
    properties:
      name:
        type: string
        default: electron
        description: The name of the application
      entry:
        type: string
        default: app/electron
        description: Entry point of the application
      id:
        type: string
        default: com.example.electron
        description: Application identifier
      version:
        type: string
        default: 0.1.0
        description: Version of the application
      title:
        type: string
        description: Title of the application
      package_name:
        type: string
        description: Package name of the application
      author:
        type: string
        description: Author of the application
      description:
        type: string
        description: Description of the application
      vendor:
        type: string
        default: flownet.ai
        description: Vendor information
      include_css:
        type: boolean
        description: Indicates if CSS should be included
      bundle_name:
        type: string
        description: Name of the bundle
      package_dir:
        type: string
        description: Directory of the package
      out_dir:
        type: string
        description: Output directory for the package
  config:
    type: object
    description: Configuration object
  src:
    type: string
    description: Source directory path
  dest:
    type: string
    description: Destination directory path
required:
  - params
  - src
  - dest