1.0.3 • Published 6 years ago

caret-killer v1.0.3

Weekly downloads
6
License
ISC
Repository
github
Last release
6 years ago

caret-killer

npm.io

Problem

I don't trust semver adherence. I've got a bunch of ^s in my package.json dependencies. I have already installed them. I want to get rid of the carets and change the dep to the current version I have installed.

Example

Allows changes that do not modify the left-most non-zero digit in the major, minor, patch tuple. In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for versions 0.X >=0.1.0, and no updates for versions 0.0.X.

https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004

This means if I have this in package.json

"babel-preset-react": "^6.3.13"

I could have 6.3.13, 6.3.14, or even 6.99.999 actually installed.

Solution

This script will change each of the caret-dependencies to the current version that is actually installed.

Installation

yarn global add caret-killer
# I wonder if I should specify a version.

Usage

cd my-cool-project-with-jacked-dependencies
caret-killer

Dev

node_modules are not included, obviously, but you need them for tests. Navigate to fixtures/ and yarn to set them up. When running in test mode, the output will be fixtures/result.package.json.