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

angelscripts-cellcmds

v1.2.0

Published

Angel Scripts for local or remote cell process management

Downloads

25

Readme

angelscripts cellcmds v1.0.0

Angel Scripts for local or remote simple cells management

usage

$ angel cell {command} {cellPath}

1. create myproject/dna/_production/cell.json

{
  "name": "myproject",
  "remote": "ssh user@remoteAddr",
  "sourceNode": ". ~/.nvm/nvm.sh && nvm use v0.10.24",
  "cwd": "~/app",
  "main": "index.js",
  "source": "git url",
  "branch": "master",
  "origin": "origin",
  "start": "{sourceNode} && cd {cwd} && ...",
  "stop": "{sourceNode} && cd {cwd} && ...",
  "restart": "{sourceNode} && cd {cwd} && ...",
  "status": "{sourceNode} && cd {cwd} && ...",
  "build": "{sourceNode} && cd {cwd} && ...",
  "install": "mkdir -p {cwd} && cd {cwd} && git clone {source} . && {sourceNode} && npm install",
  "upgrade": "git fetch {origin} && git checkout {branch} && git pull {origin} {branch} && npm install --production && {build} && {stop} && {start}",
  "upgrade-without-build": "git fetch {origin} && git checkout {branch} && git pull {origin} {branch} && npm install --production && {stop} && {start}"
  "uninstall": "rm -rf {cwd}"
}

remote property

Once present all commands will be executed using the following pattern: {remote} '{command}'

{placeholders}

Every placeholder is replaced with its corresponding value from the same json object. This is useful when different commands need to contain same instructions or to refer to the same values.

start, stop, ... commands

cell.json file contain both common variables and common commands. Commands can be invoked from command line using angel cell {command} {cellPath} pattern.

cellPath cli argument

It is a special argument which can be either:

  • relative file path to cell.json, ie ./dna/_production/cell.json
  • relative dna path to cell's dna, ie _production.cell

2. include scripts and use cell.json commands

$ cd myproject
$ npm install organic-angel --save
$ npm install angelscripts-cellcmds --save

# provide ./cell.json data & commands

$ node ./node_modules/.bin/angel cell install ./dna/_production/cell.json
$ node ./node_modules/.bin/angel cell start ./dna/_production/cell.json
$ node ./node_modules/.bin/angel cell upgrade ./dna/_production/cell.json

3. production

use forever or pm2 instead of angelscripts-nodeapps for production cells

  • Install forever or pm2 on remote hosts *

cell.json with forever

{
  ...
  "start": "forever --sourceDir {cwd} -a -l {cwd}/{main}.out --minUptime 5000 --spinSleepTime 2000 start {main}",
  "stop": "forever stop {main}",
  "restart": "forever restart {main}",
  ...
}

cell.json with pm2

{
  ...
  "start": "pm2 start {main} --name {name}",
  "stop": "pm2 stop {name}",
  "restart": "pm2 restart {name}"
  ...
}