An open API service indexing awesome lists of open source software.

https://github.com/perry-mitchell/force-latest-versions

Force latest npm package versions
https://github.com/perry-mitchell/force-latest-versions

npm npm-install npm-package semver version

Last synced: 6 months ago
JSON representation

Force latest npm package versions

Awesome Lists containing this project

README

          

# Force Latest Versions
> Force latest npm package versions.

[![npm version](https://badge.fury.io/js/force-latest.svg)](https://badge.fury.io/js/force-latest)

A CLI utility to force the installation of the latest package version of all packages in `package.json` marked as `latest`. Packages with any other version specification will be ignored. `devDependencies` is only parsed if `NODE_ENV` is not "production".

> **Please note** that in most cases using `"latest"` and always installing the latest version is not good practice.

## Usage
Run the executable by entering `force-latest`. This can be added to a package's manifest as a `postinstall` script:

```json
{
"name": "MyPackage",
"scripts": {
"postinstall": "force-latest"
},
"dependencies": {
"some-library": "latest",
"other": "^1.2.3"
},
"devDependencies": {
"force-latest": "*"
}
}
```

In this example, `some-library` will always be checked after an `npm install` is run. If it is not at the latest version as specified on [npmjs.com](npmjs.com), the latest version will be installed. The library `other` will not be checked or updated.