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

@horsepower/cli

v1.0.2

Published

horsepower command line tools for managing and creating horsepower projects.

Downloads

12

Readme

Horsepower Command Line Tool

Installation

To install the command line tool run an npm install

npm install -g @horsepower/cli

Once installed you can create projects and project files.

New Project

New projects are created by going to the directory that you want to create a new project within. The command will then create a new directory and install everything into that directory.

horsepower new <project-name>

The following steps are taken:

  1. git clone the bare bones project from github
  2. Install the node dependencies
  3. Start a test server
  4. Opens http://localhost:5000 within a browser to make sure everything works

List Commands

This allows for seeing all of the commands that are usable at the current path. This includes builtin commands and commands that are listed in a projects app/commands directory.

horsepower list

Add Package

Adds a supported @horsepower package to the current project.

horsepower add <package-name>

The following steps are taken:

  1. Check the registry to make sure the package is a horsepower package (@horsepower/<package-name>)
  2. If the package exists, install it npm i -s @horsepower/<package-name>

Remove Package

Removes a supported @horsepower package from the current project.

horsepower remove <package-name>

The following steps are taken:

  1. Check the registry to make sure the package is a horsepower package (@horsepower/<package-name>)
  2. If the package exists, remove it npm rm -s @horsepower/<package-name>

List Packages

Displays a list of packages that can be installed via package:add.

horsepower package:list

Make Controller

Make controller can create 3 different types of controllers:

  • A basic controller (default)
  • An API controller
  • A Resource controller

Creates a basic controller containing only a main endpoint. This is the default action.

horsepower make:controller <controller-name>

Creates an API controller containing only API endpoints

horsepower make:controller <controller-name> --api

Creates a Resource controller containing all resource endpoints

horsepower make:controller <controller-name> --resource

Make Middleware

Make Middleware will make middleware that can then be hooked into within your routes.

horsepower make:middleware <middleware-name>

Start Server

Starts an instance of a horsepower server application. This command will not hang the terminal and will start the server in the background. A pid will be written to the horsepower.json file in order to stop the service upon server:stop.

The server will watch for file changes in: app, config and routes. When a file changes the server will restart with the new changes.

Note: Calling server:start repeatedly on the same project will shutdown the current running server if one started successfully and start a new one thus removing the need for a server:restart command.

Note: If the server fails to start a new attempt will be taken to start the server. If the restart fails five times a restart attempt will not be taken a sixth time.

# Starts the server in the current directory
horsepower server:start

# Start the server in the specified directory
horsepower server:start /path/to/server/root

Stop Server

Stops an instance of a horsepower server application. When the server is stopped, the pid will be removed from the horsepower.json file.

# Stops the server in the current directory
horsepower server:stop

# Stops the server in the specified directory
horsepower server:stop /path/to/server/root

Server Logging

Displays the tail of the server log file at storage/framework/logs/server.log. This file will be created upon server:start, and truncated upon server:stop.

Note: Logging will not be logged to this file when in production mode.

# Shows the server log in the current directory
horsepower server:log

# Shows the server log in the specified directory
horsepower server:log /path/to/server/root

Server List

Displays all the servers that are currently running.

horsepower server:list