Skip to content

Check if a Github account with the given username exists or not

License

Notifications You must be signed in to change notification settings

shinnn/gh-account-exists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-account-exists

NPM version Build Status Coverage Status

A Node.js module to check if a Github account with the given username exists or not

const ghAccountExists = require('gh-account-exists');

ghAccountExists('shinnn').then(exists => {
  console.log(exists); // true
});

Installation

Use npm.

npm install gh-account-exists

API

const ghAccountExists = require('gh-account-exists');

ghAccountExists(username [, options])

username: String (a Github username)
options: Object (gh-get options)
Return: Promise

The returned promise will be resolved with true if the account exists, or resolved with false if it doesn't exist.

// User account
ghAccountExists('tim').then(exists => {
  console.log(exists); // true
});

// Organization account
ghAccountExists('nodejs').then(exists => {
  console.log(exists); // true
});

// Bot account
ghAccountExists('mention-bot').then(exists => {
  console.log(exists); // true
});

// Account that doesn't exist
ghAccountExists('4589iutoiy72euiiujjudjf').then(exists => {
  console.log(exists); // false
});

License

Copyright (c) 2017 Shinnosuke Watanabe

Licensed under the MIT License.

About

Check if a Github account with the given username exists or not

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published