Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.68 KB

README.md

File metadata and controls

53 lines (40 loc) · 1.68 KB

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