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.1.0 to 0.2.0

6

CHANGES.md
# CHANGES for command-line-basics
## 0.2.0
- Enhancement (breaking): Apply `cwd` option (defaulting to `process.cwd()`) to
`package.json` and `optionsPath`.
- Enhancement: Throw specific error if no `optionsPath` provided.
## 0.1.0
- Initial version

2

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

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

@@ -27,3 +27,5 @@ # command-line-basics

// JSON properties)
const optionDefinitions = cliBasics('../src/optionDefinitions.js');
const optionDefinitions = cliBasics(
path.join(__dirname, '../src/optionDefinitions.js')
);
if (!optionDefinitions) { // cliBasics handled

@@ -44,3 +46,6 @@ process.exit();

const options = cliBasics({
optionsPath: '../src/optionDefinitions.js',
// Point to a file with a `definitions` and `sections` export (or
// JSON properties)
optionsPath: path.join(process.cwd(), './src/optionDefinitions.js'),
cwd: __dirname, // As an alternative to joining
packageJsonPath: path.join(process.cwd(), 'package.json'),

@@ -47,0 +52,0 @@ options: {

@@ -13,6 +13,11 @@ 'use strict';

}
const cwd = options.cwd || process.cwd();
if (!packageJsonPath) {
packageJsonPath = join(process.cwd(), 'package.json');
packageJsonPath = join(cwd, 'package.json');
}
options = options || {};
if (!optionsPath) {
throw new TypeError(`You must include an \`optionsPath\`.`);
}
optionsPath = join(cwd, optionsPath);

@@ -19,0 +24,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