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

wercker-client

v0.0.4

Published

Wercker API Client for Node.js

Downloads

7

Readme

wercker-client

License npm version

Overview

A Node.js API client for Wercker.

Installation

npm install wercker-client --save

Usage

var Wercker = require('wercker-client').default;
var wercker = new Wercker({
  token: 'your_token'
});

Available Methods

Applications

listUserApplications

List all applications owned by the user or organization.

Example Usage
wercker.Application
  .listUserApplications({
    username: "your_application_owner_name",
    limit: 10
  }).then((res) => {
    console.log(res);
  });
Options

|Name|Description| |:--|:--| |username|Required The name of user or organization.| |stac|Optional Stack used by application. Currently supported: 1 (classic), 5 (Docker enabled) |limit|Optional Limit the results that will get returned. Default: 20. Min: 1. Max: 100. |skip|Optional Skip a certain amount of builds. |sort|Optional Sort builds using this key. Default: nameAsc. Possible values: nameAsc, nameDesc, createdAtAsc, createdAtDesc, updatedAtAsc, updatedAtDesc.

Runs

getAllRuns

Get the last 20 runs for a given pipeline or application.

Example Usage
wercker.Runs
  .getAllRuns({applicationId: "your_application_id"})
  .then((res) => {
    console.log(res);
  });
Options

Either applicationId or pipelineId must be specified.

|Name|type|Description| |:--|:--|:--| |applicationId|String|Optional The id of the application. |limit|Integer|Optional Specify how many run objects should be returned. Max: 20, default: 20 |skip|Integer|Optional Skip the first X runs. Min: 1, default: 0 |sort|String|Optional Valid values: creationDateAsc or creationDateDesc. Default creationDateDesc |status|String|Optional Filter by status. Valid values: notstarted, started, finished, running |result|String|Optional Filter by result. Valid values: aborted, unknown, passed, failed |branch|String|Optional Filter by branch |pipelineId|String|Optional Filter by pipeline |commit|String|Optional Filter by commit hash |sourceRun|String|Optional Filter by source run |author|String|Optional Filter by Wercker username


triggerNewRun

Trigger a new run for an application.

Example Usage
wercker.Runs
  .triggerNewRun({
    pipelineId: "your_pipeline_id",
    branch: "branch_name"
  }).then((res) => {
    console.log(res);
  })
Options

|Name|type|Description| |:--|:--|:--| |pipelineId|String|Required The id of the pipeline for which a run should be triggered.| |sourceRunId|String|Optional The id of the run that should be used as input for this run, including artifacts. This |is the same as chaining a pipeline. |branch|String|Optional The Git branch that the run should use. If not specified, the default branch will be used. |commitHash|String|Optional The Git commit hash that the run should used. Requires branch to be set. If not |specified, the latest commit is fetched |message|String|Optional The message to use for the run. If not specified, the Git commit message is used. |envVars|Array of objects|Optional Environment variables which should be added to run. Contains objects with keyand value properties.

Workflows

getAllWorkflows

Get the last 10 workflows.

Example Usage
wercker.Workflows
  .getAllWorkflows({applicationId: "your_application_id"})
  .then((res) => {
    console.log(res);
  });
Options

|Name|type|Description| |:--|:--|:--| |applicationId|String|Required The id of the application. |limit|Integer|Optional Specify how many workflow objects should be returned. Max: 20, default: 10 |skip|Integer|Optional Skip the first X runs. Min: 0, default: 0 |sort|String|Optional Valid values: creationDateAsc or creationDateDesc. Default creationDateDesc


getWorkflow

Get the details of a single workflow.

Example Usage
wercker.Workflows
  .getWorkflow({workflowId: "your_workflow_id"})
  .then((res) => {
    console.log(res);
  });
Options

|Name|type|Description| |:--|:--|:--| |workflowId|String|Required The id of the workflow.

Contribute

Contributions are always welcome!

License

wercker-client is available under the MIT license. See the LICENSE file for more info.