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

gittyup

v1.0.0

Published

[![build status](https://secure.travis-ci.org/crcn/gittyup.png)](http://travis-ci.org/crcn/gittyup) Gittyup is a small node.js application deployment library similar to [n](/visionmedia/n).

Downloads

11

Readme

build status Gittyup is a small node.js application deployment library similar to n.

Features

  • Command Line Interface.
  • Rollback support.
  • Script testing before using.
  • Start/Stop/Restart checked out apps.
  • Make a slug out of your app and easily move it quickly between servers.

Command Line

gup checkout daisy --repo=https://github.com/crcn/daisy.git --branch=app-branch
gup use daisy r5 #use a particular checkout 

Options

 help                                                                             
 rollback :name                                  Rollback a repositoriy           
 history :name                                   Repo history                     
 use :name :release                              Uses a repo                      
 checkout :name :repo OR checkout :name          checks out a repository

Documentation

.gittyup(rootDirectory)

root directory by default is /etc/gittyup/


var gittyup = require('gittyup')('/etc/bonsai/garden/'),
app = gittyup.app('myApp');


app.checkout('myProjectSource', function(err, result)
{

	//something went wrong in the checkout phase - most likely in linking, rollback
	if(err) return app.rollback();  
	             
	
	//test to make sure everythings good
	app.test(function(err, result)
	{
		//something went wrong in the testing phase, rollback
		if(err) return app.rollback();


		//start upp the application
		app.process(function(err, process)
		{
			process.start();
		});
	});
});

//...

.app(ops)

First argument can be either a string (app name), or object

arguments

  • name - The name of the application.
  • group - The group the application is in.
  • maxRecords - Maximum number of application records to keep locally.

.app().checkout(opsOrSource, callback)

  • opsOrSource - Options (object) or the repo source (string) for the app.
    • repository - repository of the project. Can be local directory, git repo, or .slug file

From a git repository:


gittyup.app('myApp').checkout('[email protected]:spiceapps/gittyup-test.git', function(err, result)
{
	//do stuff!
});

From a generated slug:


gittyup.app('myApp').checkout('http://mydomain.com/someApp.slug', function(err, result)
{
});

From a local directory:


gittyup.app('myApp').checkout('/some/local/path', function(err, result)
{
	
});

.app().process(callback)

Returns a runnable process of the current checked out item.



gittyup.app('myApp').process(function(err, process)
{

	process.start(function(err, result)
	{
		//...
	});

	process.stop(function(err, result)
	{
		//...
	});

	process.restart(function(err, result)
	{
		//...
	});
});


```

#### .app().test(callback)

Tests the most recent checked out item. Make sure to include "scripts:test" in your package.json. Something like:

```javascript


{
    "name": "myApp",

    "scripts": {
    	"test": "./test"
    }
}

When exiting the test program, an exit code of 0 tells gittyup the test was successful, whereas 1 tells gittyup the test failed.

.app().makeSlug(callback)

Makes a slug out of the current checkout. Use this method if you need to move the application around between servers. Once a slug is made, calling "makeSlug" on the same checkout will have no effect.


gittyup.app('myApp').makeSlug(function(err, item)
{
	console.log(item.slug); // /etc/gittyup/apps/myApp/16767565434/slug/753a644f4e7aaa7fc9132be92d000002.tar.gz

});

If you're moving the slug around, install gittyup on the other end and have something ready like this:


gittyup.app('myApp').checkout('http://myServer.com/myApp.slug', function(err, result)
{
	//...do stuff with transported slug
})

.app().current(callback)

Returns Information about the current checked out item.

.app().history(callback)

Returns checkout history of the given application.

.app().use(checkoutId)

Uses a previously used checkout item without removing the current one.

.app().remove(checkoutId, callback)

Removes a checked out item.

.app().destroy(callback)

Destroys the application, and all the checked out items.