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

pvu

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pvu - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "pvu",
"version": "0.1.0",
"version": "0.1.1",
"description": "packages version update",

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

#!/usr/bin/env node
'use strict';
"use strict";
const args = require('args');
const path = require('path');
const fs = require('fs');
const args = require("args");
const path = require("path");
const fs = require("fs");
const { splitUnit } = require("@daybrush/utils");
const { shell } = require('./utils');
const { shell } = require("./utils");
args
.option('path', 'package folder', "packages")
.option('packages', 'packages', "")
.option("path", "package folder", "packages")
.option("packages", "packages", "");

@@ -19,3 +19,2 @@ const {

const cwd = process.cwd();

@@ -26,7 +25,6 @@ const { name, version } = JSON.parse(fs.readFileSync(path.resolve(cwd, "package.json"), { encoding: "utf8" }));

packages.split(",").forEach(packagePath => {
const packageFullPath = path.resolve(packagesPath, packagePath);
const packageJSONPath = ath.resolve(packageFullPath, "package.json");
const packageJSON = fs.readFileSync(packageJSONPath);
const packagesFullPath = path.resolve(packagesPath, packagePath);
const packageJSONPath = path.resolve(packagesFullPath, "package.json");
const packageJSON = fs.readFileSync(packageJSONPath, { encoding: "utf-8" });
const
const {

@@ -38,6 +36,6 @@ version: packageVersion,

} = JSON.parse(packageJSON);
const originalVersions = originalVersion.split(".");
const originalVersions = originalVersion.replace(/^[^\d]?/g, "").split(".");
const packageVersions = packageVersion.split(".");
const changedIndex = originalVersions.find((v, i) => v !== verions[i]);
const changedIndex = originalVersions.findIndex((v, i) => v !== versions[i]);

@@ -47,3 +45,3 @@ if (changedIndex === -1) {

}
const ov = splitUnit(originalVerions[changedIndex]);
const ov = splitUnit(originalVersions[changedIndex]);
const vv = splitUnit(versions);

@@ -60,5 +58,6 @@

}
const relativePath = path.relative(cwd, packagesFullPath);
fs.writeFileSync(packageJSONPath, packageJSON.replace(packageVersion, packageVersions.join(".")), { encoding: "utf-8" });
shell(`cd ${packageFullPath} && npm i ${name}@latest`);
shell(`cd ${packageFullPath.split("/").map(v => v ? ".." : "").join("/")}/`);
shell(`cd ${relativePath} && npm i ${name}@latest`);
shell(`cd ${relativePath.split("/").map(v => v ? ".." : "").join("/")}/`);
});
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