Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

replace-json-property

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replace-json-property - npm Package Compare versions

Comparing version 1.6.3 to 1.7.0

7

bin/replace-json-property.bin.js

@@ -17,8 +17,13 @@ #!/usr/bin/env node

)
.option(
'--silent [boolean]',
'Silent mode. Executes without log messages "\\r\\n"'
)
.action(function(path, property, value) {
replaceJsonProperty.replace(path, property, value, {
spaces: commander.spaces,
EOL: commander.eol
EOL: commander.eol,
silent: commander.silent
});
})
.parse(process.argv);

2

package.json
{
"name": "replace-json-property",
"version": "1.6.3",
"version": "1.7.0",
"description": "CLI tool to replace a property in a JSON file",

@@ -5,0 +5,0 @@ "main": "src/replace-json-property.js",

@@ -6,3 +6,4 @@ const jsonfile = require('jsonfile');

spaces: 2,
EOL: '\n'
EOL: '\n',
SILENT: false
};

@@ -15,3 +16,4 @@

: DEFAULT_OPTIONS.spaces,
EOL: (options && options.EOL) || DEFAULT_OPTIONS.EOL
EOL: (options && options.EOL) || DEFAULT_OPTIONS.EOL,
silent: (options && options.silent) || DEFAULT_OPTIONS.SILENT
};

@@ -21,5 +23,7 @@ try {

jsonfile.writeFileSync(path, file, options);
log.success(
`Property: "${property}" in file: ${path} successfully overwritten with "${newValue}"`
);
if (!options.silent) {
log.success(
`Property: "${property}" in file: ${path} successfully overwritten with "${newValue}"`
);
}
} catch (error) {

@@ -26,0 +30,0 @@ log.error(error);

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