New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

command-line-basics

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-line-basics - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

6

CHANGES.md
# CHANGES for command-line-basics
## 0.4.0
- Fix: Ensure `cwd` is accessible (from object options)
- Enhancement: Apply `cwd` to an explicit relative
`packageJsonPath` (but not otherwise)
## 0.3.0

@@ -4,0 +10,0 @@

2

package.json
{
"name": "command-line-basics",
"version": "0.3.0",
"version": "0.4.0",
"description": "Auto-add help and version CLI and update notification checks",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -48,4 +48,5 @@ # command-line-basics

optionsPath: path.join(process.cwd(), './src/optionDefinitions.js'),
// As an alternative to joining (for `optionsPath` only;
// no effect on `packageJsonPath`):
// `cwd` is an alternative to joining (for `optionsPath` and for an
// explicit `packageJsonPath`; has no effect on `package.json` if
// relying on the default)
cwd: __dirname,

@@ -52,0 +53,0 @@ packageJsonPath: path.join(process.cwd(), 'package.json'),

'use strict';
const {join} = require('path');
const {join, isAbsolute} = require('path');

@@ -10,7 +10,12 @@ const updateNotifier = require('update-notifier');

module.exports = function (optionsPath, packageJsonPath, options) {
let cwd;
if (optionsPath && typeof optionsPath === 'object') {
({optionsPath, packageJsonPath, options} = optionsPath);
({optionsPath, packageJsonPath, options, cwd} = optionsPath);
}
cwd = cwd || process.cwd();
if (!packageJsonPath) {
// Don't use the user `cwd` by default for `package.json`
packageJsonPath = join(process.cwd(), 'package.json');
} else if (!isAbsolute(packageJsonPath)) {
packageJsonPath = join(cwd, packageJsonPath);
}

@@ -21,3 +26,3 @@ options = options || {};

}
optionsPath = join(options.cwd || process.cwd(), optionsPath);
optionsPath = join(cwd, optionsPath);

@@ -24,0 +29,0 @@ // eslint-disable-next-line global-require, import/no-dynamic-require

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc