# web-curl2har

> 一个浏览器环境下用于将curl命令转换成har对象的工具库

Latest version **0.0.1** (published 2024-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install web-curl2har
pnpm add web-curl2har
yarn add web-curl2har
bun add web-curl2har
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2024-03-06 |
| First published | 2024-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 957.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | reno |
| Maintainers | proud_lion |

## Links

- npm: https://www.npmjs.com/package/web-curl2har
- npm.io page: https://npm.io/package/web-curl2har

## Dependencies (2)

- [web-tree-sitter](https://npm.io/package/web-tree-sitter.md) ^0.20.8
- [parse-multipart-data](https://npm.io/package/parse-multipart-data.md) ^1.5.0

## Recent versions

- 0.0.1 (latest) — 2024-03-06

## README

# web-curl-to-har
This is a plugin used on the browser side to convert curl commands into har objects

## usage

```js
import webCurlToHar, { setConfig } from 'web-curl-to-har';

if (isElectron()) {
  if (process.env.NODE_ENV === 'development') {
    setConfig('./');
  } else {
    setConfig(window?.path.join(window.__dirname, './build/'));
  }
} else {
  setConfig('./');
}

const handleCurl2Har=()=>{
      const curl= `curl 'http://www.apipost.cn/' `
      const curlData = webCurlToHar(curl);
      console.log(curlData);
}


/*
logs:
[{"request":{"method":"GET","url":"http://www.apipost.cn/","httpVersion":"HTTP/1.1","cookies":[],"headers":[],"queryString":[],"headersSize":-1,"bodySize":-1}}]
*/

```

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