# fettuccine-class

> A class to create a new fettuccine wrapper that defaults to the given options

Latest version **2.0.0** (published 2018-09-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install fettuccine-class
pnpm add fettuccine-class
yarn add fettuccine-class
bun add fettuccine-class
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-09-13 |
| First published | 2015-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | fettuccine, fetch, request, cancelable, abortable, http, https, class, wrap, wrapper, option, options, default, defaults, get, put, patch, post, head, delete |

## Links

- npm: https://www.npmjs.com/package/fettuccine-class
- Repository: https://github.com/shinnn/fettuccine-class
- Homepage: https://github.com/shinnn/fettuccine-class#readme
- Issues: https://github.com/shinnn/fettuccine-class/issues
- npm.io page: https://npm.io/package/fettuccine-class

## Dependencies (1)

- [wise-fetch](https://npm.io/package/wise-fetch.md) ^0.3.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-09-13
- 2.0.0-0 (next) — 2018-07-06
- 1.0.5 — 2017-12-25
- 1.0.4 — 2017-12-08
- 1.0.3 — 2016-07-01
- 1.0.2 — 2016-05-16
- 1.0.1 — 2015-12-22
- 1.0.0 — 2015-12-22
- 0.0.0 — 2015-12-22

## README

# fettuccine-class

[![npm version](https://img.shields.io/npm/v/fettuccine-class.svg)](https://www.npmjs.com/package/fettuccine-class)
[![Build Status](https://travis-ci.org/shinnn/fettuccine-class.svg?branch=master)](https://travis-ci.org/shinnn/fettuccine-class)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/fettuccine-class.svg)](https://coveralls.io/github/shinnn/fettuccine-class)

A [class](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) to create a new [`fettuccine`](https://github.com/shinnn/fettuccine) wrapper that defaults to given options.

Basically end users would rather use `fettuccine` directly, which covers most use cases. `fettucine-class` is designed for library authors to create an HTTP client interacting with a specific web service or API.

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install fettuccine-class
```

## API

```javascript
const Fettuccine = require('fettuccine-class');
```

### instance = new Fettuccine([*options*])

*options*: `Object` (used as default options of instance methods)  
Return: `Object`

### instance.fetch(*url* [, *options*])

Same as [`fettuccine()`](https://github.com/shinnn/fettuccine#fettuccineurl--options), but uses options passed to the constructor by default.

```javascript
const packageInfo = new Fettuccine({
  baseUrl: 'https://registry.npmjs.org/'
});

(async () => {
  const {description} = await (await packageInfo.fetch('npm')).json();
  //=> 'a package manager for JavaScript'
})();
```

### instance.delete(*url* [, *options*]), instance.get(*url* [, *options*]),, instance.head(*url* [, *options*]), instance.patch(*url* [, *options*]), instance.post(*url* [, *options*]), instance.put(*url* [, *options*])

Set `options.method` to the corresponding method name and call `instance.fetch()`. In those function `options.method` is not configurable.

### instance.option

Default options used by `instance.fetch()`.

## License

[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe

---
_Source: https://npm.io/package/fettuccine-class · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
