1.0.2 • Published 4 years ago
now-name v1.0.2
now-name
Check whether a '.now.sh' domain name is available on ZEIT Now.
Install
~ ❯❯❯ npm install now-name
Usage
const nowName = require('now-name');
(async () => {
// Check an alias name
console.log(await nowName('carbon'));
//=> false
console.log(await nowName('deploy.now.sh'));
//=> false
console.log(await nowName('thisdoesntexist'));
//=> true
const result = await nowName.many(['deploy', 'jaymock.now.sh', 'abc123']);
console.log(result.get('deploy'));
//=> false
console.log(result.get('jaymock.now.sh'));
//=> false
console.log(result.get('abc123'));
//=> true
try {
await nowName('_ABC');
} catch (error) {
console.log(error.message);
// Invalid domain name "_ABC"
}
})();
API
nowName(name)
Check whether a .now.sh
domain name is available (not registered) on ZEIT Now.
Returns a Promise<boolean>
of whether the given domain is available.
name
Type: string
Name to check.
nowName.many(names)
Check whether multiple .now.sh
domain names are available (not registered) on ZEIT Now.
Returns a Promise<Map>
of name and status.
names
Type: string[]
Multiple names to check.
Credits
- npm-name - this module is essentially a fork of
npm-name
, modified to check the availability of ZEIT Now's.now.sh
domain names, instead of NPM package names
Related
- now-name-cli - CLI for this module
License
MIT © Nikolaos Kamarinakis