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

@valerypopoff/starter

v1.1.3

Published

A CLI tool for starting a server. Automatically restarts the app after a crash and when file changes in the directory are detected. You can close the terminal/ssh session without terminating the app

Downloads

1

Readme

starter

Starter is a CLI tool for starting a server. It's a wrapper for nodemon and forever and needs them to be installed globally.

When you start an app with Starter:

  • The app automatically restarts when file changes in the directory are detected
  • The app runs continuously and restarts after a crash
  • You can close the terminal/ssh session without terminating the app

Start: starter start app.js, stop: starter stop app.js, show logs: starter logs app.js

Install

npm install -g @valerypopoff/starter
npm install -g nodemon
npm install -g forever

Usage

Starter accepts parameters in the form:

starter [command] [script] [-options]

Both command and script are optional. If you miss out script, it'll try to find a script in the current durectory and use it. It'll look for server.js, app.js, index.js (in this order) and will take the first it finds. If nothing of the above found, the command will do nothing. If you miss out both command and script, it'll default command to start.

Start

starter start app.js

If you start the app that is already running, Starter will stop it and then start it again.

After a successfull start Starter outputs logs both into starter.out file in the script directory and into the terminal. The latter you can stop with Ctrl+C (for Linux). It will not stop the app or it's logging into starter.out file. You can later see the logs again with starter's logs command.

Since Starter can assume command and script, the following commands do the same:

starter start app.js
starter start
starter

Stop

starter stop app.js

or

starter stop

Logs

App's logs are collected in the starter.out file in the script directory. To see them in the terminal:

starter logs app.js

or

starter logs

Options

-silent

The -silent option only works with start command:

starter start app.js -silent

It prevents showing logs in the terminal after a start. It doesn't prevent logs from collecting in the starter.out file.

-nodemon_opts

This option is for passing additional options to nodemon

starter start app.js -nodemon_opts='--ignore test.js --verbose'

-forever_opts

This option is for passing additional options to forever

starter start app.js -forever_opts='--minUptime 5000'

Configuration and other tricks

Starter is a wrapper for nodemon and forever. When you start an app with Starter, it does

nohup forever ${forever_opts} --killTree --uid "${script_path}" ${nodemon_path} --cwd ${path.dirname(script_path)} ${nodemon_opts} --exitcrash -I ${script_path} > ${path.join(path.dirname(script_path), 'starter.out')} 2>&1 &

${nodemon_opts} and ${forever_opts} are strings that you pass to Starter with -nodemon_opts and -forever_opts. Use them to configure nodemon and forever when starting an app. Or turn to other configuration possibilities that don't include passing arguments. Like, placing nodemon.json file into your app's directory. After the app is strated, you can manipulate it with forever. Like, see forever's list of running apps with forever list command.