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

gh-migrations

v1.0.0

Published

GitHub Migrations CLI

Readme

gh-migrations

Export all of an organization's GitHub data using the (in preview) Migrations API

Create a migration and then download the archive, containing each repository's:

  • .git directory
  • Wiki (as git repo)
  • Issues
  • Pull Requests
  • Comments
  • Releases
  • Milestones
  • Events (e.g. issue closed then reopened)
  • Attachments (e.g. images in comments)

Note This is a temporary hack until the Migrations API comes out of preview and GitHub presumably provide a proper UI for it. It's an an extremely rough-and-ready tool: no tests, no error handling.

Installation

Requires node.js (>= 4.0)

$ npm install -g gh-migrations

Configuration

The tool can be configured using options on the command-line, or in ~/.gh.json (as for node-gh)

{
  "github_token": "e72e16c7e42f292c6912e7710c838347ae178b4a",
  "default_org": "octokit"
}
OAuth Token

This is the token used to access the GitHub API. You'll need to create a new personal access token with repo scope. You can set the token using the --token option on the command-line, or as "github_token" in ~/.gh.json

Organization

Migrations are created in the scope of a GitHub Organization. You can set the organization name using the --org option on the command-line, or as "default_org" in ~/.gh.json

Usage

Create a new migration, specifying the list of repositories to include. Repository names need to be the full name (i.e. of the form {user}/{repo})

$ gh-migrations create octokit/octokit.net octokit/go-octokit octokit/octokit.rb
Migration 4797
  State:   pending
  Created: Mon Nov 8 12:25:35 2016 +0000
  Updated: Mon Nov 8 12:25:36 2016 +0000
  Repositories:
    octokit/octokit.net
    octokit/go-octokit
    octokit/octokit.rb

View the list of existing migrations

$ gh-migrations list
┌──────────┬───────────┬─────────────────┬────────────────────────────────────┐
│ ID       │ State     │ Updated         │ Repositories                       │
├──────────┼───────────┼─────────────────┼────────────────────────────────────┤
│ 4797     │ exporting │ 1 minute ago    │ octokit/octokit.net                │
│          │           │                 │ octokit/go-octokit                 │
│          │           │                 │ octokit/octokit.rb                 │
├──────────┼───────────┼─────────────────┼────────────────────────────────────┤
│ 4791     │ exported  │ 9 hours ago     │ octokit/octokit.py                 │
└──────────┴───────────┴─────────────────┴────────────────────────────────────┘

Once the migration state changes to exported, you can download the archive:

$ gh-migrations download 4797 > gh4797.tar.gz

Library

This tool can also be used as a node module to access the Migrations API.

The library uses ES6 generators and co to emulate ES7 async/await.

Api = require("gh-migrations")

api = new Api(token)
migrations = api.migrations("octokit")

co ->
  migration = yield migrations.create([ "octokit/octokit.objc" ])
  console.log migration.state # pending

  # later
  list = yield migrations.findAll()
  migration = _.find(list, (m) -> m.id is migration.id)
  console.log migration.state # exporting

  # later still
  migration = yield migrations.get(migration.id)
  console.log migration.state # exported

  migrations.download(migration.id)
    .pipe(fs.createWriteStream("out.tar.gz"))