Skip to content

danielbayley/domain-bundle-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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