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

cosynode

v1.1.0

Published

<p align="center"><img src="./cover.jpg" height="300px"></p>

Downloads

153

Readme

CosyNode

A simpler and more cosy way to package nodejs applications into executables to run on windows and macos.


cosynode ./index.js ./dist --name=myApp --node-version=9 --upx

✔ Building macos (nodejs v9.9.0-x64)
✔ Building windows (nodejs v-9.9.0-x64-upx)

├── macos (35M)
│   ├── myApp (407K)
│   └── res
│       ├── index.js
│       └── node [34M]
│
└── windows (7.5M)
    ├── myApp.exe (182K)
    └── res
        ├── index.js
        └── node.exe (7.3M)

Many times we want to package NodeJS projects into an executable for distribution on windows and macos, but we don't need a single file (pkg's Snapshot mechanism brings a lot of uncertainty and complexity), and we don't want to use a heavy platform like electron or tauri, so we created CosyNode

CosyNode packages NodeJS to an executable entry and preserves the original directory structure, but with a small enough size

Features

  • keeping the directory structure
  • precompiled NodeJS binaries for Windows and macOS (minimum 1.8 MB)
  • entry executable is extremely small ( < 500K)

Mechanism

the mechanism of cosynode is very simple, it provides an entry executable that calls res/node in its folder and then executes res/index.js and passes its own arguments to it.

Usage

Usage: cosynode [options] [command] <input> <output>

Arguments:
  input                         js file or folder (contains index.js)>
  output                        output folder

Options:
  -V, --version                 output the version number
  --name <name>                 executables file name.
  -w, --only-win                only build for windows.
  -m, --only-mac                only build for macos.
  -n, --node-version <verison>  nodejs verison ('0', '5'(Window XP), '12'(Window 7),'14','16'); default '12'
  -u, --upx                     Use upx compressed nodejs binary (windows only)
  -h, --help                    display help for command

Nodejs Precompiled

We provide a typical nodejs version, taking into account the size of the binaries, or you can just replace them with your own nodejs binaries.

many times our NodeJS applications are very simple and newer versions of nodejs runtimes are very large. CosyNode offers a minimum version of 0.10.0, which is only 1.8 MB after UPX compression

[node v0.10]
windows/v-0.10.48-x86-upx       1.81 MB
windows/v0.10.48-x86            5.22 MB
macos/v0.10.48                  10.73 MB

[node v5]
windows/v5.12.0-x86             11.51 MB
windows/v5.12.0-x86-upx         4.29 MB
macos/v5.12.0-x64               22.7 MB

[node v12]
windows/v12.22.3-x64            28.86 MB
windows/v12.22.3-x64-upx        11.1 MB
macos/v12.22.3-x64              45.3 MB

[node v14]
windows/v14.17.2-x64            54.42 MB
windows/v14.17.2-x64-upx        18.9 MB
macos/v14.17.2-x64              72.67 MB

[node v16]
windows/v16.4.2-x64             56.7 MB
windows/v16.4.2-x64-upx         19.88 MB
macos/v16.4.2-x64               76.79 MB

System Version

| OS version | NodeJS version | | ---------- | -------------- | | Windows XP | <= 5 | | Windows 7 | <= 12 |