danielbayley / domain-bundle-id

Get a macOS bundle identifier from a domain.

Home Page:https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Domain ⮂ Bundle ID

Generate a macOS bundle identifier from a URL/domain.

Usage

import {genBundleId, getDomain} from '@danielbayley/domain-bundle-id'

const domain = 'https://domain.com/App?q=uery#anchor'

genBundleId(domain) // com.domain.App

genBundleId(domain, true) // com.domain.app

genBundleId('www.someapp.com') // com.someapp.Some

getDomain('com.domain.App') // domain.com/App

Assuming you already configured npm to work with GitHub Packages:

npm config set @danielbayley:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com:_authToken ${GITHUB_TOKEN}
npm install @danielbayley/domain-bundle-id #--save-dev

Contribute

git config core.hooksPath .github/hooks

License

MIT © Daniel Bayley