Socket
Socket
Sign inDemoInstall

default-browser-id

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

default-browser-id - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

33

cli.js
#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var meow = require('meow');
var defaultBrowserId = require('./');
var argv = process.argv.slice(2);
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Example',
' default-browser-id',
' com.apple.Safari'
].join('\n'));
}
meow({
help: [
'Example',
' $ default-browser-id',
' com.apple.Safari'
].join('\n')
});
if (argv.indexOf('--help') !== -1) {
help();
return;
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
defaultBrowserId(function (err, id) {
if (err) {
throw err;
console.error(err.message);
process.exit(1);
}

@@ -32,0 +19,0 @@

@@ -10,2 +10,6 @@ 'use strict';

module.exports = function (cb) {
if (process.platform !== 'darwin') {
throw new Error('Only OS X systems are supported');
}
bplist.parseFile(file, function (err, data) {

@@ -16,3 +20,3 @@ if (err) {

var handlers = data && data[0]['LSHandlers'];
var handlers = data && data[0].LSHandlers;

@@ -19,0 +23,0 @@ if (!handlers || handlers.length === 0) {

{
"name": "default-browser-id",
"version": "1.0.3",
"version": "1.0.4",
"description": "Get the bundle identifier of the default browser (OS X). Example: com.apple.Safari",
"license": "MIT",
"bin": {
"default-browser-id": "cli.js"
},
"repository": "sindresorhus/default-browser-id",

@@ -13,10 +10,8 @@ "author": {

"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
"url": "sindresorhus.com"
},
"bin": "cli.js",
"engines": {
"node": ">=0.10.0"
},
"os": [
"darwin"
],
"scripts": {

@@ -30,4 +25,5 @@ "test": "mocha"

"keywords": [
"cli-app",
"cli",
"osx",
"mac",
"browser",

@@ -41,8 +37,7 @@ "default",

"identifier",
"uti",
"cli",
"bin"
"uti"
],
"dependencies": {
"bplist-parser": "0.0.6",
"bplist-parser": "^0.1.0",
"meow": "^3.1.0",
"untildify": "^2.0.0"

@@ -49,0 +44,0 @@ },

@@ -9,3 +9,3 @@ # default-browser-id [![Build Status](https://travis-ci.org/sindresorhus/default-browser-id.svg?branch=master)](https://travis-ci.org/sindresorhus/default-browser-id)

```sh
```
$ npm install --save default-browser-id

@@ -19,3 +19,3 @@ ```

console.log(browserId);
//=> com.apple.Safari
//=> 'com.apple.Safari'
});

@@ -27,3 +27,3 @@ ```

```sh
```
$ npm install --global default-browser-id

@@ -36,3 +36,3 @@ ```

Example
default-browser-id
$ default-browser-id
com.apple.Safari

@@ -39,0 +39,0 @@ ```

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