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

@andimeier/deploy-node

v0.1.1

Published

Deployment made easy for node projects

Downloads

10

Readme

deploy-node

Deploys Javascript applications. To be used as a npm script because some properties will be drawn from the environment variables which npm adds for the scripts.

At the moment, it simply builds a node application, the result being:

  • a build folder cointaining the executable application
  • a tar.gz file containing the targz'ed build folder (this is the "deployment package")

Folder structure

The specified build folder (the "dist" folder) will be populated with the following items:

  1. an application folder
  2. the targz'ed application folder

The filename of both is:

PROJECT_VERSION+TIMESTAMP

So, the folder is e.g.:

spectre_v1.2.3/

while the deployment package is

spectre_v1.2.3.tar.gz

Steps

deploy-node will perform the following steps:

  • copy all source files to the dist folder in a subfolder named after the project, e.g. dist/PROJECT_v1.0.0
  • install node_modules with --production flag, so only the production dependencies are installed
  • generate a version file
  • targz the folder

Installation

Include the deploy scripts using:

npm install --save-dev deploy-node

This will install the deploy-node libs into your node_modules and a binary named deploy in node_modules/.bin, so that npm scripts can use the deploy command.

Usage

Typical usage is to include deploy-node in your npm scripts in package.json like this:

{
  ...
  "scripts": {
	"build": "deploy --version-file version.json"
  }
}

List all available options with deploy --help, the output will be something like this:

deploy.js

  Deployment script for node and Angular apps.

Options

  -v, --verbose                Verbose output
  -m, --message message        Deployment message
  --timestamp                  Add timestamp to filename of output file
  --detect-config-changes      Warn if the config files have changed since the last tagged version
  --print-last-commit          Print the log message of the last commit
  -p, --project name           Name of the project as it. This will be used as a prefix for the filename of
                               the deployment package. If omitted, the script tries to retrieve the project
                               name from the environment (this only works if the script was invoked via 'npm
                               run'). In this case, the project name specified in the package.json file will
                               be used.
  --workdir-clean              Warn if the work directory is dirty
  --version-file filename      File name of version file to be written. If omitted, no version file will be
                               generated.
  -b, --batch                  Enable batch mode. There are no interactions, no user confirmations etc.
                               Suitable for e.g. a build triggered by a CI server
  -o, --build-folder folder    Folder in which the build takes place. The contents of this folder will then
                               be packaged to the output file. Default is `dist`.
  -s, --source-folder folder   Folder containing the source file to be packaged. The contents of this folder
                               will be transferred to the build folder, then packaged to the output file.
                               Default is `src`.
  -z, --tar-gz                 Tarzip the result. When this option is given, the build folder will contain
                               a folder with
  -h, --help                   Display this help message