Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including node-okbitbucket with all npm packages installed. Try it out:

var nodeOkbitbucket = require("node-okbitbucket")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-okbitbucket v1.0.10

Wrapper for the BitBucket API

node-okbitbucket

Mac/LinuxWindows

Build Status | Windows Build status

API to programmatically query / write on bitbucket.

Pure NodeJS implementation.

Install

    npm i node-okbitbucket --save

Usage


    var secrets = {
        username:'',
        password:'',
        oauth = {
            clientId: '',
            secret: ''
        }
    };

    // var secrets = require('./secrets.json');
    
    // enable debug messages
    if ( process.env.NODE_ENV === 'test' ){
      process.env.DEBUG='*';
    }
    
    var BitBucket = require('node-okbitbucket');
    
    var bbt = (new BitBucket())
            .authenticatePassword(secrets.username, secrets.password);

    bbt.getUserApi().getRepositories(username, function(err, repos){  });
    
    bbt.getUsersApi().getUserData(username, function(err, user){  });
    
    bbt.getSshApi().getKeys(function(err, keys){  });
    bbt.getSshApi().addKey(pubkey, function(err){  });
    bbt.getSshApi().deleteKey(pubkey, function(err){  });
    bbt.getSshApi().deleteAllKeys(function(){  });
    
    bbt.getRepoApi().show(username, repo, function(err, userRepo){  })
    bbt.getRepoApi().getUserRepos(username, function(err, repositories){  })
    
    
    bbt.getEmailApi().getAll(username, repo, function(err, userRepo){  })
    

Documentation

Test

npm run test
DEBUG=node-okbitbucket mocha

Todo

  • write documentation
  • write missing tests (see tests files directly)
  • re write example
  • fix lint

About this repo

It s a fork or original repo found on github, itself a fork of a bitbucket repo.

I only want to note about the license, i see there is one, i m not interested into this, not at all.

I just need this to work, the rest is pointless.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free