a simple port of https://github.com/intridea/oauth2.
importOAuth2from'oauth2-node'constclientConfig={site: HOST}constclient=newOAuth2.Client(APP_ID,SECRET,clientConfig)constauthURL=client.authCode().getAuthorizeURL({redirect_uri: '/oauth/callback'})client.authCode().getToken('code',redirect_uri).then(token=> ...)client.password().getToken('username','password').then(token=> ...)client.clientCredentials().getToken().then(token=> ...)client.assertion().getToken(params).then(token=> ...)MIT