Negatory. Postpone Mission.
Miss any of our Open RFC calls?Watch the recordings here! »

now-name

1.0.2 • Public • Published

now-name Build Status

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

License

MIT © Nikolaos Kamarinakis

Install

npm i now-name

DownloadsWeekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

6.26 kB

Total Files

5

Last publish

Collaborators

  • avatar