JSPM

travis-got

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 249
  • Score
    100M100P100Q84210F
  • License MIT

Convenience wrapper for `got` to interact with the Travis API

Package Exports

  • travis-got

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (travis-got) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

travis-got Build Status

Convenience wrapper for got to interact with the Travis API

Install

$ npm install --save travis-got

Usage

Instead of:

const got = require('got');

got('https://api.travis-ci.org/repos/SamVerschueren/travis-got', {
    json: true,
    headers: {
        accept: 'application/vnd.travis-ci.2+json'
    }
}).then(res => {
    console.log(res.body.repo.slug);
    //=> 'SamVerschueren/latest-push'
});

You can do:

const travisGot = require('travis-got');

travisGot('repos/SamVerschueren/travis-got').then(res => {
    console.log(res.body.repo.slug);
    //=> 'SamVerschueren/latest-push'
});

Or:

const travisGot = require('travis-got');

travisGot('https://api.travis-ci.org/repos/SamVerschueren/travis-got').then(res => {
    console.log(res.body.repo.slug);
    //=> 'SamVerschueren/latest-push'
});

API

Same as got (including the stream API and aliases), but with some additional options:

token

Type: string

Travis access token.

Can be overridden globally with the TRAVIS_TOKEN environment variable.

endpoint

Type: string
Default: https://api.travis-ci.org/

To support Travis Enterprise.

Can be overridden globally with the TRAVIS_ENDPOINT environment variable.

License

MIT © Sam Verschueren