1.0.0 • Published 2 years ago
macos-bundle-name v1.0.0
macos-bundle-name
macos-bundle-name is a lightweight utility to retrieve the bundle name from a bundle identifier on macOS.
Installation
You can install this package via npm:
npm install macos-bundle-nameUsage
Here's a quick example of how to use this package:
const getBundleName = require("macos-bundle-name");
const bundleName = getBundleName("com.apple.Safari");
console.log(bundleName); // 'Safari'
const nonExistentBundle = getBundleName("com.nonexistent.Bundle");
console.log(nonExistentBundle); // nullAPI
getBundleName(bundleIdentifier: string): string | null
Retrieves the bundle name associated with the given bundle identifier.
Parameters
bundleIdentifier(string): The bundle identifier to look up.
Returns
string | null: The name of the bundle if found, otherwisenull.
Example
const getBundleName = require("macos-bundle-name");
const bundleName = getBundleName("com.apple.Safari");
console.log(bundleName); // 'Safari'
const nonExistentBundle = getBundleName("com.nonexistent.Bundle");
console.log(nonExistentBundle); // nullTypeScript
This package includes TypeScript definitions.
import getBundleName from "macos-bundle-name";
const bundleName: string | null = getBundleName("com.apple.Safari");License
This project is licensed under the MIT License. See the LICENSE file for details.
1.0.0
2 years ago