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

mup-node

v0.8.2

Published

Plugin for Meteor Up to deploy Node apps

Downloads

178

Readme

mup-node plugin

Deploy your Node.js apps with Meteor Up!

This plugin is under development and is missing some features.

Getting started

First, install mup and mup-node with:

npm i -g mup mup-node

Second, create a config with bash mup init

Open the config, and make the following adjustments:

For each server:

  • host - Usually is the IP Address of the server
  • server authentication - You can use a password or set pem to the path to a private key. If neither are set, it uses ssh-agent

In the app section:

  • name: A unique name, with no spaces
  • path: Path to the app, relative to the config.
  • type: Set to node to let mup know that this plugin will manage the app

Add a plugins array with mup-node:

module.exports = {
  // ... rest of config
  plugins: [ 'mup-node' ]
};

Third, setup the server. Mup will install everything needed to run the app. Run:

mup setup

Fourth, deploy the app. Run

mup deploy

Mup will upload your app, build a docker container, and run it.

Bundling

mup-node copies the app's files to the server. The .git and node_module directories are ignored.Additional directories can be ignored by creating a .mupignore file in your app's root folder. .mupignore uses the same syntax as .gitignore.

Building Image

The base image is node:<node version>. As long as the package.json doesn't change, the node_modules is cached between deploys.

You can add instructions to the Dockerfile in the config at app.docker.buildInstructions. For more details, look at the example in the next section.

If your package.json has a mup:postinstall script, it will be run after npm install.

Options

mup-node is configured with the app object in your config. The available options are:

module.exports = {
  app: {
    name: 'name-of-app',
    path: '../path/to/app',
    type: 'node',
    nodeVersion: '8.8.1',
    servers: {
      one: {},
      two: {}
    },
    env: {
      MONGO_URL: 'mongodb://localhost:8000',
      // Port the app is available on, defaults to 80
      PORT: 5000
    },
    // Amount of time to allow the app to start. If the app isn't running within this
    // much time, mup rolls back to the previous version. Set to -1 to disable.
    deployCheckWaitTime: 60,
    // NPM script to run when starting the app
    startScript: 'start:production'
    docker: {
      args: ['--network=net'],
      networks: ['net2', 'net3'],
      // Dockerfile instructions to run before adding the app and running `npm install`
      buildInstructions: [
        // Copy some of the app's files needed for the post-install script
        'COPY ./scripts ./scripts',
        'RUN apt-get update && apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++ -y',
      ],
      // Port expose from the container. This does not affect the port the app is accessed on. Default is 3000
      imagePort: 3000
    }
  },
  plugins: [ 'mup-node' ]
};