Socket
Socket
Sign inDemoInstall

bundle-name

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundle-name - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

7

index.js

@@ -1,4 +0,5 @@

'use strict';
const runApplescript = require('run-applescript');
import {runAppleScriptAsync} from 'run-applescript';
module.exports = bundleId => runApplescript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
export default async function bundleName(bundleId) {
return runAppleScriptAsync(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
}
{
"name": "bundle-name",
"version": "2.0.1",
"description": "Get bundle name from a bundle identifier (OS X): com.apple.Safari → Safari",
"license": "MIT",
"repository": "sindresorhus/bundle-name",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"osx",
"plist",
"applescript",
"bundle",
"bundleid",
"bundlename",
"id",
"identifier",
"CFBundleName",
"CFBundleIdentifier",
"uti"
],
"dependencies": {
"run-applescript": "^2.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
"name": "bundle-name",
"version": "3.0.0",
"description": "Get bundle name from a bundle identifier (macOS): `com.apple.Safari` → `Safari`",
"license": "MIT",
"repository": "sindresorhus/bundle-name",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"macos",
"plist",
"applescript",
"bundle",
"bundleid",
"bundlename",
"id",
"identifier",
"CFBundleName",
"CFBundleIdentifier",
"uti"
],
"dependencies": {
"run-applescript": "^5.0.0"
},
"devDependencies": {
"ava": "^3.15.0",
"xo": "^0.38.2"
}
}

@@ -1,25 +0,20 @@

# bundle-name [![Build Status](https://travis-ci.org/sindresorhus/bundle-name.png?branch=master)](http://travis-ci.org/sindresorhus/bundle-name)
# bundle-name
> Get [bundle name](https://developer.apple.com/library/Mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleName) from a [bundle identifier](https://developer.apple.com/library/Mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleIdentifier) (OS X): `com.apple.Safari` → `Safari`
> Get [bundle name](https://developer.apple.com/library/Mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleName) from a [bundle identifier](https://developer.apple.com/library/Mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleIdentifier) (macOS): `com.apple.Safari` → `Safari`
## Install
```
$ npm install --save bundle-name
$ npm install bundle-name
```
## Usage
```js
const bundleName = require('bundle-name');
import bundleName from 'bundle-name';
bundleName('com.apple.Safari').then(name => {
console.log(name);
//=> 'Safari'
});
console.log(await bundleName('com.apple.Safari'));
//=> 'Safari'
```
## Related

@@ -29,6 +24,1 @@

- [bundle-id](https://github.com/sindresorhus/bundle-id) - Get bundle identifier from a bundle name
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

Sorry, the diff of this file is not supported yet

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