An open API service indexing awesome lists of open source software.

https://github.com/condenast/copilot-util

Condé Nast - Copilot JavaScript utilities
https://github.com/condenast/copilot-util

maintained

Last synced: 6 months ago
JSON representation

Condé Nast - Copilot JavaScript utilities

Awesome Lists containing this project

README

          

![Logo](assets/loris.png)

# copilot-util

Condé Nast - copilot JavaScript utilities

[![Build Status](https://travis-ci.org/CondeNast/copilot-util.svg?branch=master)](https://travis-ci.org/CondeNast/copilot-util)
[![Code Climate](https://codeclimate.com/github/CondeNast/copilot-util/badges/gpa.svg)](https://codeclimate.com/github/CondeNast/copilot-util)
[![Coverage Status](https://coveralls.io/repos/github/CondeNast/copilot-util/badge.svg?branch=master)](https://coveralls.io/github/CondeNast/copilot-util?branch=master)

## Maintainers

- Zack Tollman ([@tollmanz](https://github.com/tollmanz) / zackary_tollman@condenast.com)

## Install

[![NPM](https://nodei.co/npm/copilot-util.png?compact=true)](https://nodei.co/npm/copilot-util/)

## Examples

Usage examples can be found in [/examples](examples)

```shell
npm run-script examples
```

# API

* http.request()
* http.response()
* error.HttpError()
* error.TimeoutError()
* json.parse()

---
### HTTP


`http.request(options) => Promise~Response → Buffer` ([module](lib/http/request))


`http.response(response) => Promise~Response → Buffer` ([module](lib/http/response))

---
### Error


`error.HttpError(message, statusCode) => HttpError` ([module](lib/error))


`error.TimeoutError(message, timeout) => TimeoutError` ([module](lib/error))

---
### JSON


`json.parse(data) => Promise → Object` ([module](lib/json))

___

## Developer

### Lint/Tests

Linting is done through [eslint](http://eslint.org) with settings from `.eslintrc`. This happens automatically as part of the `pretest` script when running tests.

Tests are written with [mocha](https://npmjs.org/package/mocha) and can be run through the npm test script.

```shell
$ npm test
```
## License

MIT