npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitbucketjs

v1.0.2

Published

A Bitbucket API client for javascript

Downloads

826

Readme

Bitbucket.js

Bitbucket.js is a low-level javascript http client for the Bitbucket REST API. It works great in both node and the browser. It allows you to build requests with its promise interface.

Build Status

Requirements

You'll need a newer (v0.12+) version of node with native Promise support or browsers that implement the Promise constructor directly. Alternatively, either polyfill Promise in the global scope or pass the Promise constructor to Bitbucket.js when creating the client.

API

Require Bitbucket.js using CommonJS or AMD-style require. If the environment does not support either of these, bitbucketjs will attach itself as window.bitbucketjs.

Bitbucketjs currently only allows login through basic authentication.

Construct a client object like so:

var bitbucketjs = require('bitbucketjs');
var bitbucket = bitbucketjs({username: 'myuser', password: 'mypassword'});

A number of resources are available through the client, with many actions available that map directly to their REST api equivalents. Bitbucketjs will return to you the response body of the API response.

bitbucket.repo

bitbucket.repo.fetch('myteam/myrepo')

Returns a Promise thenable that resolves to the repository myrepo for the team (or user) myteam.

This method requires authentication to retrieve private repositories.

bitbucket.repo.forOwner('myuser')

Returns a Promise thenable that resolves to a list of the given user or team's repository.

bitbucket.repo.create('myteam/myrepo', opts)

opts

Object.

opts.scm - the version control system of the repo. Can be git or hg. opts.is_private - true for private repositories. opts.description - the repository's description. opts.has_issues - true to create this repository with an issue tracker. Defaults to false. opts.has_wiki - true to create this repository with a wiki. Defaults to false.

opts accepts all the keys and values that match the parameters of the the API repository resource.

Returns a Promise thenable that resolves if the repository was successfully created.

bitbucket.repo.delete('myteam/myrepo')

Deletes the repository at the given slug. Be careful!

This method requires authentication. Only repositories for which the authenticated user has admin permissions may be deleted.

bitbucket.user

bitbucket.user.fetch(username)

Returns a Promise thenable that resolves to the user of the given username.

bitbucket.user.followers(username)

Returns a Promise thenable that resolves to a list of followers of the username.

bitbucket.team

bitbucket.team.fetch(teamname)

Returns a Promise thenable that resolves to the team matching teamname.

bitbucket.team.followers(teamname)

Returns a Promise thenable that resolves to a list of followers of the teamname.

bitbucket.team.mine(role='member')

Returns a Promise thenable that resolves to a list of the authenticated user's teams. role can be one of member, admin, or contributor. role defaults to member.

This method requires authentication.