@livestorm/cli
Advanced tools
+1
-1
| { | ||
| "name": "@livestorm/cli", | ||
| "version": "1.2.0", | ||
| "version": "1.3.0", | ||
| "description": "CLI that allows you to build and deploy your Livestorm plugin", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-10
| const { execSync } = require('child_process') | ||
| const { default: fetch } = require('node-fetch') | ||
| const prompts = require('prompts') | ||
@@ -7,10 +6,4 @@ const semverGte = require('semver/functions/gte') | ||
| const configStore = require('../helpers/configStore.js') | ||
| const checkCurrentVersion = require('./version').getModuleVersion | ||
| const { checkCurrentVersion, checkLatestVersion } = require('./version') | ||
| async function checkLatestVersion() { | ||
| const response = await fetch('https://registry.npmjs.org/@livestorm/cli') | ||
| const json = await response.json() | ||
| return json['dist-tags']['latest'] | ||
| } | ||
| async function checkCandidateForUpgrade() { | ||
@@ -51,4 +44,3 @@ try { | ||
| console.log('Upgrading @livestorm/cli to the latest version ...') | ||
| execSync('yarn global upgrade @livestorm/cli@latest') | ||
| console.log('All done 🙌') | ||
| execSync('yarn global upgrade @livestorm/cli@latest', { stdio: 'inherit' }) | ||
| } | ||
@@ -55,0 +47,0 @@ |
+23
-6
| const fs = require('fs') | ||
| const path = require('path'); | ||
| const path = require('path') | ||
| const { default: fetch } = require('node-fetch') | ||
| const semverGte = require('semver/functions/gte') | ||
| function getModuleVersion() { | ||
| function checkCurrentVersion() { | ||
| const file = fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf8') | ||
@@ -9,9 +11,24 @@ return JSON.parse(file).version | ||
| function printModuleVersion() { | ||
| console.log(getModuleVersion()) | ||
| async function checkLatestVersion() { | ||
| const response = await fetch('https://registry.npmjs.org/@livestorm/cli') | ||
| const json = await response.json() | ||
| return json['dist-tags']['latest'] | ||
| } | ||
| async function printModuleVersion() { | ||
| const currentVersion = checkCurrentVersion() | ||
| const latestVersion = await checkLatestVersion() | ||
| console.log(`Current version: ${currentVersion}`) | ||
| if (semverGte(currentVersion, latestVersion)) { | ||
| return console.log('You are using the latest version') | ||
| } | ||
| console.log(`You can upgrade to ${latestVersion} with \`livestorm upgrade\``) | ||
| } | ||
| module.exports = { | ||
| getModuleVersion, | ||
| printModuleVersion | ||
| checkCurrentVersion, | ||
| printModuleVersion, | ||
| checkLatestVersion | ||
| } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
183692
0.21%1289
0.55%