Interact with the GitHub organisation teams API
A node library to interact with the GitHub organisation teams API
const ghteams = require'ghteams'authOptions = user: 'rvagg' token: '24d5dee258c64aef38a66c0c5eca459c379901c2'// note the auth token needs the 'user' scope to deal with org teams// list all teams in an organisationghteamslistauthOptions 'myorg'// Array of team data for 'myorg'console.logteamlist// get team data by team name in an organisationghteamsgetauthOptions 'myorg' 'myteam'// object containing full team data for myorg/myteamconsole.logteam// get team data by team id (quicker)ghteamsgetauthOptions 123456// object containing full team data team #123456console.logteam// get team members by team name in an organisationghteamsmembersauthOptions 'myorg' 'myteam'// Array containing full list of team members for myorg/myteamconsole.logmembers// get team members by team id (quicker)ghteamsmembersauthOptions 123456// Array containing full list of team members team #123456console.logmembers// get teams to which the user represented by `authOptions` is a member ofghteamsuserTeamsauthOptions// Array cotnaining full list of teams to which the current// authenticated user belongsconsole.logteams
The auth data is compatible with ghauth so you can just connect them together to make a simple command-line application:
const ghauth = require'ghauth'ghteams = require'ghteams'authOptions =configName : 'team-lister'scopes : 'user'ghauthauthOptionsghteamslistauthData 'myorg'console.log'Teams in "myorg": ' listmapreturn tnamejoin', '
ghteams is Copyright (c) 2014 Rod Vagg @rvagg and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.