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

@schallert/buildnode

v1.0.1

Published

Node module for Buildkite APIs

Downloads

3

Readme

buildnode

Node module for Buildkites API

js-standard-style npm-downloads-month npm-version

Installation

npm install buildnode

Instantiation

buildnode(options)

You need to specify one of accessToken or email and password.

Examples

Rebuild latest build for a pipeline

var Buildnode = require('buildnode')({
  accessToken: "abc123"
})

var organizationName = "myOrg"
var pipelineName = "myPipeline"

// Fetch the organization
Buildnode.getOrganization(organizationName, function (err, myOrg) {
  if (err) {
    throw err
  }
  // Check if we got anything
  if (!myOrg) {
    throw new Error('Error fetching organization')
  }
  // Fetch the pipeline
  myOrg.getPipeline(pipelineName, function (err, myPipeline) {
    if (err) {
      throw err
    }
    // Check we fetched the pipeline
    if (!myPipeline) {
      throw new Error('Invalid pipeline name')
    }
    myPipeline.listBuilds(function (err, builds) {
      if (err) {
        throw err
      }
      // First entry is latest build
      builds[0].rebuild()
    })
  })
})

API

Methods

listOrganizations(callback)

Lists all organizations that your credentials have access to.

getOrganization(name, callback)

Returns an organization class for name

Organization

Fields

  • name: (string) The organization name

Methods

listPipelines(callback)

List all pipelines available under this organization.

getPipeline(name, callback)

Returns an instance of pipeline for name

createPipeline(data, callback)

Creates a new pipeline under this organization.

listAgents(callback)

List all available agents.

getAgent(id, callback)

Returns an instance of agent for id

Agent

Fields

  • id: (string) ID of the agent
  • name: (string) Name of the agent
  • ip: (string) IP of the agent
  • state: (string) Connection state for the agent
  • version: (string) Agent version
  • metaData: (object) Agent metadata

Methods

stop(callback)

Stops the agent.

Pipeline

Fields

  • id: (string) ID of the pipeline
  • name: (string) Name of the pipeline
  • slug: (string) Slug for the pipeline

Methods

delete(callback)

Delete this pipeline.

update(data, callback)

Update the pipeline.

listBuilds(callback)

Returns an array of instances of build for this pipeline.

getBuild(number, callback)

Returns an instance of build for build number.

createBuild(data, callback)

Create a new build.

Build

Fields

  • id: (string) ID of the build
  • number: (number) Build number
  • jobs: ([Job]) Jobs for this build
  • state: (string) State of the build
  • message: (string) Build message
  • branch: (string) Build branch

Methods

cancel(callback)

Cancel an in-progress build.

rebuild(callback)

Rebuild a build.

listArtifacts(callback)

Returns an array of instances of artifact for this build.

getArtifact(id, callback)

Return an instance of artifact for id

Job

Fields

  • id: (string) ID of the job
  • name: (string) Name of the job
  • command: (string) Command for the job

Methods

unblock(callback)

Unblocks this step.

getLog(callback)

Returns the command output for this step.

listArtifacts(callback)

Returns an array of instances of artifact for this job.

Artifact

Fields

  • id: (string) ID of the artifact
  • jobId: (string) ID of the job that uploaded this artifact
  • path: (string) Path to the uploaded artifact
  • size: (string) Size of the artifact
  • hash: (string) Hash of the artifact

Methods

download(callback)

Returns a stream for the artifact