• Stars
    star
    260
  • Rank 157,189 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Manage repository easily.

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

also support alias which could config at alias of ~/.projj/config.json:

$ projj add github://popomore/projj

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]

You can set change_directory in ~/.projj/config.json to change directory automatically.

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

More Repositories

1

koa-proxy

Proxy middleware for koa
JavaScript
222
star
2

github-labels

Add github labels automatically
JavaScript
177
star
3

jshint-practice

配置 jshint 的最佳实践
JavaScript
48
star
4

gulp-scp2

Copy file to remote server, using scp2 that is a pure javascript implement.
JavaScript
27
star
5

liquidluck-theme-reveal

liquidluck theme for reveal.js
Python
21
star
6

rename

Rename files using some transformers.
JavaScript
17
star
7

connect-combo

connect middleware for assets combo
JavaScript
16
star
8

projj-hooks

JavaScript
15
star
9

spy

spy and mock for simple testcase
JavaScript
14
star
10

ypkgfiles

Yet another pkgfiles that generate pkg.files automatically
JavaScript
13
star
11

social-share

A simple and easy-to-use social share tool.
JavaScript
13
star
12

gulp-mirror

Make a mirror of stream
JavaScript
12
star
13

checkurl

A tiny url status check tool
JavaScript
11
star
14

gulp-load

Load gulp task just like grunt.loadTasks.
JavaScript
11
star
15

schedule

A tiny cron-like tools for humman
JavaScript
10
star
16

chmod

chmod for nodejs
JavaScript
8
star
17

chuome

chuo.me Blog
JavaScript
8
star
18

decmdify

Transform CMD module to CommonJS
JavaScript
7
star
19

father

A package parser that can resolve self and dependencies, supporting spm, component.
JavaScript
7
star
20

gitx

Use git with custom identity file
JavaScript
6
star
21

puzzle

A puzzle game using aralejs
JavaScript
5
star
22

resolve-files

Get all files from the given entry that resolved by `require`
JavaScript
5
star
23

fzhidao

抓取百度知道的问题
Python
5
star
24

stream-switch

Stream condition for switch/case
JavaScript
4
star
25

findlinks

Find the broken links
JavaScript
4
star
26

nodejs-logo

Node.js logo
3
star
27

pan

Resolve pan.baidu.com download url
JavaScript
3
star
28

combo2

A simple assets combo server.
JavaScript
3
star
29

combo-url

resolve combo url
JavaScript
3
star
30

zhi

a key/value parser support simple template
JavaScript
3
star
31

test-id

2
star
32

exists-case

Wrap fs.exists for case sensitivity
JavaScript
2
star
33

puerh

a sinonjs assertion wrapper for expect
JavaScript
2
star
34

ibump

change version, create tag, publish to npm
JavaScript
1
star
35

foursquare-category

翻译 @4sq 的分类,帮助大家更好的选择和区分。
JavaScript
1
star
36

go-utils

1
star
37

istanbul-instrument

JavaScript
1
star
38

lrrrrc

Easy way to download lrc based on nodejs
JavaScript
1
star
39

gulp-switch

shim to stream-switch
Makefile
1
star
40

generator-popomore

my generator
JavaScript
1
star
41

nunjucks-vs-swig

JavaScript
1
star
42

configy

a configuration file parser
JavaScript
1
star
43

c8-mocha

JavaScript
1
star
44

fscache-stream

a passtrough stream caching buffer to file system
JavaScript
1
star
45

css-imports

find all @import in css
JavaScript
1
star
46

check-compiler

Makefile
1
star
47

css2str

transform css to string that can be inserted by js
JavaScript
1
star
48

cjsify

1
star
49

istanbul-example

istanbul example
JavaScript
1
star