# fetch-as-curl

> Making a cURL command from fetch API.

Latest version **0.0.1** (published 2018-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install fetch-as-curl
pnpm add fetch-as-curl
yarn add fetch-as-curl
bun add fetch-as-curl
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-02-01 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | yayoc |
| Maintainers | yayoc |
| Keywords | fetch, cURL, browser, console, TypeScript |

## Links

- npm: https://www.npmjs.com/package/fetch-as-curl
- Repository: https://github.com/yayoc/fetch-as-curl
- Homepage: https://github.com/yayoc/fetch-as-curl#readme
- Issues: https://github.com/yayoc/fetch-as-curl/issues
- npm.io page: https://npm.io/package/fetch-as-curl

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2018-02-01

## README

# fetch-as-curl

Making [cURL](https://curl.haxx.se/) command output on browser console when using [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

## Fetures

* Make a cURL command on browser console.
* Same interface with Fetch API.

## Installation

Using `npm`.  
`npm i fetch-as-curl`

## Example

```js
import "fetch-as-curl";
const options = {
  method: "POST",
  body: JSON.stringify({
    rating: 5,
    comment: "cool!"
  }),
  headers: {
    Authorization: "Bearer foo",
    "Content-Type": "application/json"
  }
}
fetch("http://somesite.com/reviews", options)
  .then(res => /* Do something */)
```

> In console

```sh
curl -X POST -H "Authorization: Bearer foo" -H "Content-Type: application/json" -d '{"rating": 5, "comment": "cool!"}' http://somesite.com/some.json
```

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