Socket
Socket
Sign inDemoInstall

envinfo

Package Overview
Dependencies
93
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.9.1 to 3.10.0

2

package.json
{
"name": "envinfo",
"version": "3.9.1",
"version": "3.10.0",
"description": "Info about your dev environment for debugging purposes",

@@ -5,0 +5,0 @@ "repository": "https://github.com/tabrindle/envinfo",

@@ -94,2 +94,17 @@ # envinfo

- --browsers - will print the versions of Chrome, Firefox and Safari if installed.
```bash
...
Browsers:
Chrome: 62.0.3202.94
Chrome Canary: 64.0.3271.0
Firefox: 57.0
Firefox Developer Edition: 57.0
Firefox Nightly: 58.0a1
Safari: 11.0
Safari Technology Preview: 11.1
...
```
## Contributing

@@ -96,0 +111,0 @@ PRs for additional features are welcome! Run `npm run lint && npm run format` before commiting.

@@ -25,2 +25,12 @@ #!/usr/bin/env node

if (options) {
if (options.browsers && process.platform === 'darwin') {
options.clipboard ? log.push('Browsers:') : log.push('\x1b[4mBrowsers:\x1b[0m');
var browsers = helpers.browserBundleIdentifiers;
var browserVersions = Object.keys(browsers).map(function browserMap(browser) {
return ' ' + browser + ': ' + helpers.getDarwinApplicationVersion(browsers[browser]);
});
log = log.concat(browserVersions);
log.push('');
}
if (options.packages) {

@@ -27,0 +37,0 @@ var packageJson = helpers.getPackageJsonByPath('/package.json');

@@ -9,2 +9,12 @@ var childProcess = require('child_process');

var browserBundleIdentifiers = {
Chrome: 'com.google.Chrome',
'Chrome Canary': 'com.google.Chrome.canary',
Firefox: 'org.mozilla.firefox',
'Firefox Developer Edition': 'org.mozilla.firefoxdeveloperedition',
'Firefox Nightly': 'org.mozilla.nightly',
Safari: 'com.apple.Safari',
'Safari Technology Preview': 'com.apple.SafariTechnologyPreview',
};
function uniq(arr) {

@@ -37,2 +47,22 @@ return Array.from(new Set(arr));

function findDarwinApplication(id) {
var appPath;
try {
appPath = run('mdfind "kMDItemCFBundleIdentifier=="' + id + '""').replace(/(\s)/g, '\\ ');
} catch (error) {
appPath = false;
}
return appPath;
}
function generatePlistBuddyCommand(appPath, options) {
var optionsArray = (options || ['CFBundleShortVersionString']).map(function optionsMap(option) {
return '-c Print:' + option;
});
return ['/usr/libexec/PlistBuddy']
.concat(optionsArray)
.concat([appPath])
.join(' ');
}
function getAndroidStudioVersion() {

@@ -43,10 +73,6 @@ var androidStudioVersion = 'Not Found';

androidStudioVersion = run(
[
'/usr/libexec/PlistBuddy',
'-c',
'Print:CFBundleShortVersionString',
'-c',
'Print:CFBundleVersion',
'/Applications/Android\\ Studio.app/Contents/Info.plist',
].join(' ')
generatePlistBuddyCommand('/Applications/Android\\ Studio.app/Contents/Info.plist', [
'CFBundleShortVersionString',
'CFBundleVersion',
])
)

@@ -94,2 +120,17 @@ .split('\n')

function getDarwinApplicationVersion(bundleIdentifier) {
var version;
try {
version = run(
generatePlistBuddyCommand(
path.join(findDarwinApplication(bundleIdentifier), 'Contents', 'Info.plist'),
['CFBundleShortVersionString']
)
);
} catch (error) {
version = 'Not Found';
}
return version;
}
function getNodeVersion() {

@@ -194,5 +235,9 @@ var nodeVersion;

module.exports = {
browserBundleIdentifiers: browserBundleIdentifiers,
findDarwinApplication: findDarwinApplication,
generatePlistBuddyCommand: generatePlistBuddyCommand,
getAllPackageJsonPaths: getAllPackageJsonPaths,
getAndroidStudioVersion: getAndroidStudioVersion,
getCPUInfo: getCPUInfo,
getDarwinApplicationVersion: getDarwinApplicationVersion,
getModuleVersions: getModuleVersions,

@@ -199,0 +244,0 @@ getNodeVersion: getNodeVersion,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc