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

yackage

v0.9.2

Published

Build native desktop apps with Node.js

Downloads

76

Readme

yackage

Package your Node.js project into an executable.

This project is targeted for apps built with Yue library and Yode Node.js runtime.

Install

npm i -g yackage

Usage

Usage: yackage [options] [command]

Options:

  --platform <platform>          Target platform (default: $npm_config_platform ||
                                 process.platform)
  --arch <arch>                  Target arch (default: $npm_config_arch ||
                                 process.arch)
  --app-dir <dir>                Path to the source code dir of app (default:
                                 current working dir)
  --unpack <pattern>             Files to ignore when generating asar package
                                 (default: *.node)
  --unpack-dir <pattern>         Dirs to ignore when generating asar package
  --no-minify                    Do not minify the JavaScript source code
  --extra-info-plist             The extra string to insert into the Info.plist
  --identity <identity>          The identity used for signing app bundle on macOS
  --entitlements <entitlements>  Path to the entitlements file when signing app
                                 bundle on macOS

Commands:

  init                     Create an empty project under current directory
  build <outputDir>        Build app bundle
  dist <outputDir>         Build app bundle and generate app distribution
  dirty-build <outputDir>  Build app bundle without reinstalling modules

Note that before using Yackage, the target app must have fetch-yode listed as a dependency.

Configuration

Configure your project by adding following fields to package.json:

{
  "build": {
    "appId": "com.app.id"
    "productName": "App"
    "copyright": "Copyright © 2020 Company",
    "minify": true,
    "unpack": "+(*.node|*.png)",
    "unpackDir": "{assets,build}",
    "ignore": [ "assets/*" ],
    "icons": {
      "win": "assets/icon.ico",
      "mac": "assets/icon.icns"
    },
    "extraInfoPlist": "<key>LSUIElement</key><true/>"
  }
}

Examples

Generate executable from the app under current working directory:

cd /path/to/app/
yackage build out

Generate executable from path under arbitrary path:

yackage build out --app-dir /path/to/app

Generate executable for arbitrary platform:

yackage build out --platform win32 --arch ia32

Generate distributions:

yackage dist out --app-dir /path/to/app

How yackage works

  1. Run npm pack to generate tarball for the app.
  2. Extract the tarball to temporary directory and run npm install.
  3. Use asar to pacakge the app and its dependencies.
  4. Append the generated ASAR archive to Yode.
  5. Yode would automatically recognize the ASAR archive appended in the executable and start with it.

Differences from packaging in Electron

By default yackage would unpack the .node files so they are not extracted dynamically when running, otherwise anti-virus softwares would complain.

The unpacked files are placed in the res directory instead of the usual .unpacked directory, so the final distribution would look more formal.

The .js files are compressed with uglify-js by default.

The virutal root directory of ASAR archive is ${process.execPath}/asar. Using process.execPath as virutal root directory directly would confuse Node.js since it should be a file.

License

Public domain.