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

@jerexyz/projj

v1.4.1

Published

Manage repository easily.

Downloads

1

Readme

Projj

Manage repository easily.

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Why?

How do you manage git repository?

Maybe you create a directory and clone to it. However if you want to clone repository that has same name? Or Do something in every directory like clean?

Projj provide a structure making it easy.

$BASE
|- github.com
|  `- popomore
|     `- projj
`- gitlab.com
   `- popomore
      `- projj

And you can DO everything in repository by Hook.

Feature

  • ✔︎ Add repository using projj add
  • ✔︎ Command Hook
  • ✘ Buildin Hook
  • ✔︎ Custom Hook
  • ✔︎ Run Hook in All Repositories
  • ✔︎ Git Support

Installation

Install projj globally.

$ npm i projj -g

Usage

Initialize

$ projj init

Set base directory which repositories will be cloned to, default is ~/projj.

You can change base directory in ~/.projj/config.json.

Add Repository

$ projj add [email protected]:popomore/projj.git

it's just like git clone, but the repository will be cached by projj. You can find all repositories in ~/.projj/cache.json

Importing

If you have some repositories in ~/code, projj can import by projj import ~/code.

Or projj can import repositories from cache.json when you change laptop by projj import --cache

Find Repository

projj provide a easy way to find the location of your repositories.

$ projj find [repo]

Sync

projj sync will check the repository in cache.json whether exists, the repository will be removed from cache if not exist.

Hook

Hook is flexible when manage repositories.

Command Hook

When run command like projj add, hook will be run. preadd that run before projj add, and postadd that run after projj add.

Config hook in ~/.projj/config.json

{
  "hooks": {
    "postadd": "cat package.json"
  }
}

Then will show the content of the package of repository.

Only support add now

Define Hook

You can define own hook.

{
  "hooks": {
    "hook_name": "command"
  }
}

For Example, define a hook to show package.

{
  "hooks": {
    "show_package": "cat package.json"
  }
}

Then you can use projj run show_package to run the hook in current directory.

Command can be used in $PATH, so you can use global node_modules like npm.

{
  "hooks": {
    "npm_install": "npm install"
  }
}

Write Hook

Write a command

// clean
#!/usr/bin/env node

'use strict';

const cp = require('child_process');
const cwd = process.cwd();
const config = JSON.parse(process.env.PROJJ_HOOK_CONFIG);
if (config.node_modules === true) {
  cp.spawn('rm', [ '-rf', 'node_modules' ]);
}

You can get PROJJ_HOOK_CONFIG from projj if you have defined in ~/.projj/config.json.

{
  "hooks": {
    "clean": "clean"
  },
  "clean": {
    "node_modules": true
  }
}

Run Hook

projj run clean in current directory.

projj runall clean in every repositories from cache.json

License

MIT