create-windowless-app
TypeScript icon, indicating that this package has built-in type declarations

11.0.3 • Public • Published

Create Windowless App

CodeQL Actions Status node types commit license create-windowless-app Known Vulnerabilities codecov Renovate visitors Downloads

Create a windowless Node.js app.

You can also start from this template repository create-windowless-app-template

Create Windowless App works on Windows 64-bit only
If something doesn't work, please file an issue.

Pre-Requisites for template to work:

  • NodeJS version 20.0.0 or higher
  • MSBuild.exe must be in the PATH environment variable
  • signtool must be in the PATH environment variable

Quick Overview

npx create-windowless-app my-app

Note: There's an open issue regarding running npx on Windows when the user folder path contains a space. For more info and a workaround: npx#146

Or with npm

You can install create-windowless-app globally:

npm install -g create-windowless-app

And then you can run:

create-windowless-app my-app

npx create-windowless-app my-app

Or in interactive mode:

npx create-windowless-app --interactive

npx create-windowless-app --interactive

Project Structure

create-windowless-app creates the following files:

my-app
├── node_modules
├── package.json
├── sea-config.json
├── tsconfig.json
├── tsconfig.build.json
├── webpack.config.js
├── launcher
│   ├── launcher.cs
│   ├── launcher.csproj
|   ├── launcher.ico
|   └── launcherCompiler.ts
├── resources
│   └── bin
│       └── my-app-launcher.exe
└───src
    └── index.js

No configuration or complicated folder structures, just the files you need to build your app.

Once the installation is done, you can build the project

cd my-app
npm run build

Then you can find in your my-app\dist folder the following files:

dist files

  • my-app.exe is the compiled app, with Node.js bundled (using Single Executable Applications)
  • my-app-launcher.exe is the compiled launcher.cs file that executes my-app.exe without a console window
  • snoretoast-x64.exe allows windows notification (using node-notifier)
  • my-app.log will be generated on first run (using winston logger)

create-windowless-app CLI

create-windowless-app <project-directory> [options]

Options:
    --no-typescript                 use javascript rather than typescript
    --no-husky                      do not install husky pre-commit hook for building launcher
    --icon <icon>                   override default launcher icon file

    --interactive                   interactive mode

Only <project-directory> is required.

Why?

Node.js does not have a native windowless mode (like java has javaw). Sometimes, you want to run an app as a scheduled task that runs in the background, or run a long task (i.e. a server) but do not want a console that must always be open. Best solution I could find is using a script that executes the Node.js in windowless mode

This package comes to do the following:

  1. Compile a Node.js (javascript/typescript) project into an *.exe file bundled with Node.js, so no installation is needed
  2. Compile a C# launcher that executes the compiled project, in windowless mode

Template project

The "Hello World" template is a POC containing 2 features you might want when running a windowless app:

  1. Logger
  2. Notifications

The template project build script does the following things

  1. Compiles TypeScript to JavaScript (if in a TypeScript template)
  2. Runs WebPack to bundle all JavaScript into a single file, and copy binary files into the "dist" folder
  3. Runs Node's single executable applications scripts to compile the single WebPack JavaScript output file to an exe file bundled with Node.js (Currently experimental in Node.js 20)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
11.0.31latest

Version History

VersionDownloads (Last 7 Days)Published
11.0.31
11.0.20
11.0.10
11.0.00
10.5.00
11.0.0-beta.00
10.0.30
10.0.20
10.0.10
10.0.00
9.3.70
9.3.50
9.3.30
9.3.20
9.3.10
9.3.00
9.2.40
9.2.30
9.2.20
9.2.10
9.2.00
9.1.20
9.1.10
9.1.00
9.0.20
9.0.10
9.0.00
8.0.40
8.0.30
8.0.20
8.0.10
8.0.00
7.12.00
7.11.10
7.11.00
7.10.00
7.9.120
7.9.110
7.9.100
7.9.90
7.9.80
7.9.70
7.9.60
7.9.20
7.9.10
7.9.00
7.8.00
7.7.00
7.6.10
7.6.01
7.5.12
7.5.00
7.4.10
7.4.00
7.3.110
7.3.100
7.3.90
7.3.80
7.3.70
7.3.60
7.3.50
7.3.40
7.3.30
7.3.20
7.3.10
7.3.00
7.2.10
7.2.00
7.1.30
7.1.20
7.1.10
7.1.00
7.0.30
7.0.21
7.0.10
7.0.00
6.0.11
6.0.00
5.2.10
5.2.00
5.1.20
5.1.10
5.1.00
5.0.30
5.0.20
5.0.11
5.0.00
4.2.00
4.0.20
4.0.10
3.4.90
3.4.80
3.4.70
3.4.60
3.4.50
3.4.40
3.4.30
3.4.20
3.4.11
3.4.00
3.3.100
3.3.90
3.3.80
3.3.70
3.3.60
3.3.50
3.3.40
3.3.30
3.3.20
3.3.10
3.3.00
3.2.00
3.1.10
3.0.00
2.4.00
2.3.140
2.3.130
2.3.120
2.3.110
2.3.100
2.3.90
2.3.80
2.3.70
2.3.60
2.3.50
2.3.00
2.2.90
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.1.20
2.1.10
2.1.00
2.0.10
2.0.00
1.0.00
0.2.80
0.2.70
0.2.60
0.2.50
0.2.30
0.2.20
0.2.10
0.2.00
0.1.10
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i create-windowless-app

Weekly Downloads

8

Version

11.0.3

License

MIT

Unpacked Size

440 kB

Total Files

37

Last publish

Collaborators

  • yoavain