Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
/ npm-use-latest Public archive

Append the latest commit ID to each github dependency in package.json

Notifications You must be signed in to change notification settings

cmmartin/npm-use-latest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npm-use-latest

How it works

  1. Searches your package.json for github dependencies, indicated by the github: prefix
  2. Fetches their latest commit ID using git ls-remote
  3. Appends the new commit ID to the dependency, forcing npm to install the latest version
Before
{
  ...
  "dependencies": {
  	"react": "github:facebook/react",
  	"lodash": "github:lodash/lodash"
  }
}
During
$ npm-use-latest
Fetching latest commit ID for react
Fetching latest commit ID for lodash
Successfully updated package.json
After
{
  ...
  "dependencies": {
    "react": "github:facebook/react#4045747af6bb83a73ef6057abd07017ee056a5f7",
    "lodash": "github:lodash/lodash#2c5f026d3c59a38c429246513437681569b523b8"
  }
}

Install

npm i -g cmmartin/npm-use-latest

I'll publish this to npm eventually and save you those extra 9 characters

Usage

Navigate to your project root and run it!

cd path/to/my/project/root
npm-use-latest

Requirements

  • A recent enough version of npm that supports github dependencies
  • A recent enough version of node.js that supports ecma 6 syntax (const, arrow functions, etc)
  • git

About

Append the latest commit ID to each github dependency in package.json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published