Skip to content

Instantly share code, notes, and snippets.

@Flet
Created July 28, 2015 22:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flet/9b558b3607353ef49f90 to your computer and use it in GitHub Desktop.
Save Flet/9b558b3607353ef49f90 to your computer and use it in GitHub Desktop.
starlord
starlord
sync stars from github -> npm
* must be logged in to npm
* must have git config github.user set? or pass via flag?
- fetch current npm starred
npm stars
- fetch current github starred
https://api.github.com/users/:me:/starred
- for each github starred
- fetch package.json
- https://raw.githubusercontent.com/:owner:/:repo:/master/package.json
- if 404 its not a valid repo
- capture the "name" field
- generate list of package.name from github
- wait for both to finish
- generate list of repos to star in npm
- remove existing npm stars from github list by comparing package.name
- present list of repos that will be starred and wait for confirmation from user (Y)
- for each name in the github list that is left
- npm star :name:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment