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

nodejs-sea

v1.0.1

Published

A powerful package for NodeJS single executable applications (SEA), support good for NestJS framework

Downloads

162

Readme

Table of Contents

Description

This feature allows the distribution of a Node.js application conveniently to a system that does not have Node.js installed.

Node.js supports the creation of single executable applications by allowing the injection of a blob prepared by Node.js, which can contain a bundled script, into the node binary. During start up, the program checks if anything has been injected. If the blob is found, it executes the script in the blob. Otherwise Node.js operates as it normally does.

The single executable application feature currently only supports running a single embedded script using the CommonJS module system.

Users can create a single executable application from their bundled script with the node binary itself and any tool which can inject resources into the binary.

To use this CLI, you must use Node.js 18+.

API document

You can visit the full API documents in here

Installation

You can install the library using npm:

npm install nodejs-sea

With yarn

yarn add nodejs-sea

CLI usage

Run build script with npx

npx nodejs-sea sea
Options:
      --version         Show version number             [boolean]
  -s, --sea-config      Path of the sea config file     [string] [default: "sea/config.json"]
  -n, --node-version    Node.js version                 [string] [default: "*"]
  -c, --clean           Remove generated files          [boolean] [default: true]
      --help            Show help                       [boolean]

Example

To build the single executable applications from source, please create the folder sea, and put the config.json file

{
  "main": "sea/dist/server-out.js",
  "output": "sea/dist/viactapp.blob"
}

If you want copy some files from your source to your build output, put them into copyFiles

{
  "main": "sea/dist/server-out.js",
  "output": "sea/dist/viactapp.blob",
  "copyFiles": ["src/config.json", ".env"]
}

If you want run esbuild before, put esbuild config into esbuild

{
  "main": "sea/dist/server-out.js",
  "output": "sea/dist/app.blob",
  "esbuild": {
    "entryPoints": ["main.js"],
    "bundle": true,
    "outfile": "sea/dist/server-out.js",
    "platform": "node",
    "external": ["@aws-sdk/client-s3", "hbs"],
    "packages": "bundle"
  }
}

Contact and Feedback

If you have any ideas, comments, or questions, don't hesitate to contact me

Best regards,

Daniel Le

License

This library is licensed under the MIT License. See the LICENSE file for more details.