# pkg-and-serve

> boilerplate for packaging a static server with an app in an exe

Latest version **1.1.2** (published 2022-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install pkg-and-serve
pnpm add pkg-and-serve
yarn add pkg-and-serve
bun add pkg-and-serve
```

Provides the command `pkg-and-serve`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-08-14 |
| First published | 2022-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 42.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sean S. LeBlanc |
| Maintainers | seansleblanc |

## Links

- npm: https://www.npmjs.com/package/pkg-and-serve
- npm.io page: https://npm.io/package/pkg-and-serve

## Dependencies (6)

- [pkg](https://npm.io/package/pkg.md) ^5.8.0
- [open](https://npm.io/package/open.md) ^8.0.7
- [yargs](https://npm.io/package/yargs.md) ^17.5.1
- [express](https://npm.io/package/express.md) ^4.18.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [portfinder](https://npm.io/package/portfinder.md) ^1.0.32

## Recent versions

- 1.1.2 (latest) — 2022-08-14
- 1.1.1 — 2022-08-14
- 1.1.0 — 2022-08-14

## README

# `pkg-and-serve`

This project allows you to package a static website as a single executable file. This executable will start a local server hosting your site, open it in the user's default browser, and shut itself down when the site is closed.

Note that this is most useful for quickly creating a shareable file for testing/portable deployment, and will usually be a less ideal user experience when compared with a full desktop application (e.g. with [Electron](https://www.electronjs.org/)).

## Usage

### As command-line tool

```sh
npx pkg-and-serve [input] [output]
```

### As boilerplate project

1. clone
2. `npm i`
3. replace contents of `./app` with your app
4. update `name` in `pkg.config.json`
5. add additional localhost endpoints in `server.js` if needed
6. `npm run build`
7. self-contained build outputs will be in `./build`

---
_Source: https://npm.io/package/pkg-and-serve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
