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

nx-deploy

v1.0.1

Published

Deployment tool for services over ssh

Downloads

11

Readme

nx-deploy

Deployment tool for services over ssh

Install PM2

$ npm install pm2 -g

Initializing

$ deploy init --host my-ssh-host

This will create a default .deploy.yml file. The deployment file is used to configure the deployment scripts.

Deploying

$ deploy deploy

This will deploy the application with the .deploy.yml configuration.

Deployment Configuration

The configuration is kept in the .deploy.yml.

A deployment is splitted into multiple steps and every step can be individually changes through the configuration.

The default steps are [INITIALIZE, ENSURE, INITIALIZED, APP_UPLOAD, BEFORE_START, START_APP, AFTER_START, BLUEGREEN, BEFORE_STOP, STOP_APP, AFTER_STOP, APP_READY]

Each step can be customized with any commands. An plugin interface to add more commands is planned for the next release. Currently there are just 3 commands: ssh, scp, ensure

INITIALIZE

This will copy all deployment scripts from nx-deploy onto the server. It will check if the log & config directory for nginx exists.

ENSURE

This step will ensure that nodejs is installed, :nodeVersion is v7.10.0 by default. Afterwards it will install pm2 globally to use it as the process manager. Then it will run npm install for the nx-deploy scripts.

INITIALIZED

This will strip the extensions of the scripts in the scripts folder. This is just as an example to show how scripts can be transferred to the host and be used to enhance the service and/or deployment process.

APP_UPLOAD

This step ensures that a versioned Capistrano-like structure will be created. It will first ensure that a directory exists. Then will find an empty port and get a timestamp, using the ssh-save feature to save it to the env. Afterwards using the timestamp to copy the application into the versioned directory.

BEFORE_START

Currently not in use...

START_APP

Telling pm2 to start the application on the free port.

AFTER_START

Currently not in use...

BLUEGREEN

Using the standard nginx configuration, replace the port with the found free port. Stop nginx... This will cause a short downtime... and start it with the newly created configuration.

BEFORE_STOP

Currently not in use...

STOP_APP

Use an nodejs script to kill all other processes

AFTER_STOP

Currently not in use...

APP_READY

And we are done with the basic deployment