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 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-server-repo

v1.2.2

Published

A custom git command which creates a remote repository specifically for git deployments.

Downloads

22

Readme

Installation

npm install git-server-repo -g

Ensure this is installed GLOBALLY in order for it to work as a custom git command

Purpose

I wanted to setup a git repo on my server which would perform some actions on my code once pushed.

Additional Use Cases

  1. Update your website with a simple git push ... command
  2. Work on your Raspberry Pi remotely using your preferred device/IDE.

How It Works

On your server/raspberry pi you will have a git repository which accepts commits from other devices (aka your computer where you are working), moves your projects files to your desired directory and then runs a build script on those files (optional).

Why not use post-install in your package.json file?

git-server-repo is more versatile as it does not require that you are using node or npm for your project, specifically.

Example - a C program can be compiled after I push it to my Raspberry Pi.

Example 1

I want to practice my C programming on my Raspberry Pi but...:

  1. I don't have a computer monitor hooked up directly to the Pi
  2. I do don't want to use VIM or NANO as my editors when I SSH into my Pi
How To - High Level
  1. I enable SSH on my Raspberry Pi
  2. Then I SSH into my Rasberry Pi
  3. Move myself into the desired directory where I would like my final project files to exist (your/project). Example - here will be your .c files
  4. Run git server-repo
  5. Save the generated "remote url" location somewhere for use later
  6. Open the your/project/.git/hooks/post-receive file and add whatever commands you would like to execute after a new update is received
  7. On the device where you will be coding (laptop/desktop/etc), add a remote to your git repo using the remote url from step 5
  8. git push <your-remote> master
  9. View your compiled project files in your/project

Setup

  1. Enable SSH on your Raspberry Pi

  2. SSH into your server/Raspberry Pi

ssh <username>@<ip/domain>

Enter your password if prompted

  1. Install git-server-repo package using npm
$ npm i git-server-repo -g
  1. Move into the directory where you would like your final project files
cd your/project

You can optionally just use the --working-dir flag and specify your desired directory. Example: --working-dir=your/project

  1. Build the server repository
git server-repo
  1. Copy/save the generated "remote url"
ssh://<your-username>@<your-server-ip>/your/project/.git
  1. Edit the post-receive file with the custom build commands you would like:
nano your/project/.git/hooks/post-receive

You will want to make all your changes BELOW the following comments

#
# DO WHAT YOU WANT WITH THE FILES YOU'VE JUST PUSHED
# example:
#
#   $ gcc app.c -o app
#
# The above compiles your app.c file into an executable after each push
  1. Now, in a new terminal window, open the project you've been working on. Ensure there is a git repository already setup for your project

  2. Add your server/Raspberry Pi as a remote in your git repo. This will allow you to push your code to your server/Raspberry Pi

git remote add <remote-name> <your-generated-remote-url>
git remote add raspberry-pi ssh://<your-username>@<your-server-ip>/your/project/.git
  1. Now you can push your code to your server/raspberry pi simply by running the following command
git push raspberry-pi master

The above pushes your master branch to the remote repository. Once there, the post-receive file will move your files to the your/project/directory and run your custom commands