bitbucket-v2 v0.6.0
node-bitbucket-v2
node.js library to access the Bitbucket API v2
usage
Not supported for Node < 7.6
const Bitbucket = require('node-bitbucket-v2');
const bitbucketApi = new Bitbucket(options);
bitbucketApi.authenticateOAuth2(accessTokenString);
bitbucketApi.user.get().then(({ body }) => {
console.log(body.uuid);
});
options
It is not necessary to provide any options at all (Bitbucket
can be constructed with no argument).
requesterFn
((options) => Promise<any>
): If provided, requests will be made using the function you provide. This is allows you to use your preferred http client. Theoptions
provided are{ headers, hostname, method, path, query, url, body? }
.body
is only provided onPOST
methods. In the case ofgetNextPage
,getPreviousPage
,getForksFromResponse
andgetParentFromResponse
, only{ headers, method, url }
are provided in the options. Example:const axios = require('axios'); const Bitbucket = require('node-bitbucket-v2'); const requesterFn = (options) => { const { url, method, body } = options; if (method === 'POST') { return axios.post(url, body); } return axios.get(url); }; const bitbucketApi = new Bitbucket({ requesterFn });
proxy
(String
): Defines a proxy to make requests against, instead ofapi.bitbucket.org:443
. This option is ignored whenrequesterFn
is provided.
For implemented methods, check bitbucket/repositories.js
and bitbucket/user.js
.
5 years ago
5 years ago
5 years ago
5 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago