Socket
Socket
Sign inDemoInstall

yarn-upgrade-all

Package Overview
Dependencies
8
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.3.0

19

index.js

@@ -6,3 +6,10 @@ #!/usr/bin/env node

const chalk = require('chalk')
const commander = require('commander')
const pkg = require('./package.json')
commander.version(pkg.version)
.option('-g --global', 'upgrade packages globally', false)
.parse(process.argv)
const logError = (message) => {

@@ -18,3 +25,11 @@ console.log(chalk.red('[Error]: ' + message))

const packagePath = path.resolve(process.cwd(), 'package.json')
let packagePath = null
let global = ''
if (commander.global) {
global = ' global'
packagePath = path.resolve(process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'], '.config', 'yarn', 'global', 'package.json')
} else {
packagePath = path.resolve(process.cwd(), 'package.json')
}
if (!fs.existsSync(packagePath)) {

@@ -36,3 +51,3 @@ logError('Cannot find package.json file in the current directory')

for (let pkg of packages) {
const command = `yarn remove ${pkg} && yarn add${option} ${pkg}`
const command = `yarn${global} remove ${pkg} && yarn${global} add${option} ${pkg}`
try {

@@ -39,0 +54,0 @@ logInfo(command)

5

package.json
{
"name": "yarn-upgrade-all",
"version": "0.2.1",
"version": "0.3.0",
"description": "This is a command line utility program to upgrade all the packages in your package.json to the latest version (potentially upgrading packages across major versions).",

@@ -18,4 +18,5 @@ "bin": {

"dependencies": {
"chalk": "^2.3.0"
"chalk": "^2.3.0",
"commander": "^2.12.2"
}
}

@@ -37,3 +37,9 @@ # yarn-upgrade-all

Or upgrade global packages:
```
yarn-upgrade-all --global
```
## How does it work?

@@ -40,0 +46,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc