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

bump-npm

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bump-npm - npm Package Compare versions

Comparing version

to
0.0.9

2

package.json
{
"name": "bump-npm",
"version": "0.0.8",
"version": "0.0.9",
"description": "bump package version and publish",

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

@@ -18,4 +18,17 @@ #!/usr/bin/env node

const currentVersion = packageJson.version;
const dependencies = packageJson.dependencies;
const devDependencies = packageJson.devDependencies;
const peerDependencies = packageJson.peerDependencies;
function updateVersionNumber(version) {
function updateJson(version, devAsPeer, rewind = false) {
if (rewind && devAsPeer) {
packageJson.dependencies = dependencies;
packageJson.devDependencies = devDependencies;
packageJson.peerDependencies = peerDependencies;
} else if (devAsPeer) {
packageJson.peerDependencies = packageJson.peerDependencies || [];
packageJson.peerDependencies.push(...packageJson.dependencies);
packageJson.dependencies = undefined;
packageJson.devDependencies = undefined;
}
packageJson.version = version;

@@ -44,3 +57,3 @@ fs.writeFileSync(fileName, JSON.stringify(packageJson, null, 2));

updateVersionNumber(
updateJson(
semver.inc(

@@ -51,3 +64,4 @@ currentVersion,

settings.prefix
)
),
args.deptopeer
);

@@ -58,3 +72,3 @@

if (stderr) {
updateVersionNumber(currentVersion);
updateJson(currentVersion, args.deptopeer, true);
throw stderr;

@@ -61,0 +75,0 @@ } else {