# simple-req

> a simple http request for text content

Latest version **1.0.2** (published 2022-12-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-req
pnpm add simple-req
yarn add simple-req
bun add simple-req
```

## 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 | 1.0.2 |
| Published | 2022-12-02 |
| First published | 2022-11-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fwg |
| Maintainers | adf0001 |
| Keywords | simple, http, request, text |

## Links

- npm: https://www.npmjs.com/package/simple-req
- Repository: https://github.com/adf0001/simple-req
- Homepage: https://github.com/adf0001/simple-req#readme
- Issues: https://github.com/adf0001/simple-req/issues
- npm.io page: https://npm.io/package/simple-req

## 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

- 1.0.2 (latest) — 2022-12-02
- 1.0.1 — 2022-11-30
- 1.0.0 — 2022-11-29

## README

# simple-req
a simple http request for text content

# Install
```
npm install simple-req
```

# Usage & Api
```javascript

var simple_req = require("simple-req");
//or var simple_req = require("simple-req/req-by-node");		//only for node
//or var simple_req = require("simple-req/req-by-browser");		//only for browser

/*
simple_req(requestOptions, requestData, cb)
	requestOptions
		...
			refer to node/http.request/options
			
		.dataTimeout
			A number specifying the timeout in milliseconds after the socket is connected.

		.url
			A url string.

		.form
			set true if requestData is a form data object.

	requestData
		request body text, or json object, or null,
		or a form data object when requestOptions.form is true.
	
	cb
		function( error, result= { res, body [, json] } )
*/
simple_req(
	{ url: 'http://localhost/', method: 'GET' },
	null,
	(err, result) => {
		console.log(err, result?.body, result?.json);
	}
);

```

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