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

launchpod

v1.0.6

Published

LaunchPod is a lightweight and flexible Node.js module which aims to ease the development process. Think Nodemon + REPL.

Downloads

29

Readme

LaunchPod

LaunchPod is a lightweight and flexible Node.js module which aims to ease the development process. Think Nodemon + REPL.

Instalation

npm install launchpod

and

node node_modules/launchpod your-app.js

or

node node_modules/launchpod your-app your-config-file

Features

REPL

  • Type this and see which properties and methods are exposed at your app.
  • Run/evaluate functions, promises and properties.
  • Objects are pretty printed with Node's util.inspect.
  • Execute a function returning a promise and receive the resolved value.
  • Type a function name and see it's String representation.

Remote REPL

  • Send commands to your app from another application, terminal or script. Eg.: Restart you app from Sublime Text with a single shortcut.

Uncaught Exception handling

  • launchpod will ask if it should quit or restart on Uncaught Exceptions.

(Simple) file watching and restart

  • launchpod can be set to restart your application if any .js file was created or modified.

More

  • No strings attached. No need to keep this module while in production.
  • Lifecycle events - a beforeShutdownCmd function can be set to run before quitting or restarting the app.
  • Lightweight, just native dependencies.

Default commands

Type .help while in REPL to list available commands.

|.command| action| |---|---| | .quitApp |Quit application | | .qa |Quit application (alias) | |.restart |Restart application| |.rs |Restart application (alias)| |.watcherOff |Disable restart on file changes| |.wof |Disable restart on file changes (alias)| |.watcherOn |Enable restart on file changes| |.won |Enable restart on file changes (alias)|

Configuration file reference

A configuration can be specified as follows: node node_modules/launchpod your-app your-config-file

Config files are simple JSON files.

| property| effect | |---|---| |welcomeMessage | String - Sets the welcome message displayed when an user connects on REPL. Eg.: "We have liftoff!" | |promptSymbol | String - Sets a custom prompt symbol. Eg.: "⚡️ ". Default: '_ ' | |beepOnUncaughtException | Bool - Enable terminal bell on Uncaught Exceptions. Default: false | |beforeShutdownCmd | String - Sets a script to be evaluated before the app's shutdown. Eg.: beforeShutdown(); bye(); | |watchFileChange | Bool - Enables app restart on file changes. Default: false | |watcherThrottleTime | Number - Delay of app restart in milliseconds |

How to...

Use REPL from another terminal instance

While in the app directory, use NetCat: nc -U ./socket-ctl

Type .exit to quit remote REPL.

Restart with a script or from another app

echo ".restart" | nc -U ./socket-ctl

Restart app from Sublime Text

  • Create a new Build System with the following content:
{
  "shell_cmd": "echo \".restart\" | nc -U ./socket-ctl",
  "working_dir": "${project_path:${folder}}"
}
  • Save the build file
  • Set the build system with your new file
  • Command+B or Control+B will trigger the build system, restarting your app. ;-)

Load a script once

  • Connect to the REPL: nc -U ./socket-ctl
  • Type: .load your-script

Scope, globals, etc...

The REPL scope is restricted to you app, there is no access to any of Node's globals.

If you wish any of this, expose it in your app's module.

Example

var app = {
  console,
  require,
  beforeShutdown: () => {
    console.log("beforeShutdown stuff is being done ...");
  },
}

module.exports = app;

Restart on file changes

Set true for the key watchFileChange at your configuration file. Don't forget to use the config file:

node node_modules/launchpod your-app your-config-file

Credits

Icon designed by Freepik