Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmetonurslmz/smoothly-request
Perform request with promise based client on NodeJS
https://github.com/ahmetonurslmz/smoothly-request
javascript nodejs promise request
Last synced: about 1 month ago
JSON representation
Perform request with promise based client on NodeJS
- Host: GitHub
- URL: https://github.com/ahmetonurslmz/smoothly-request
- Owner: ahmetonurslmz
- License: mit
- Created: 2021-05-06T22:28:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-12T05:01:42.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T10:09:11.304Z (2 months ago)
- Topics: javascript, nodejs, promise, request
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/ahmetonurslmz/smoothly-request.svg?branch=main)](https://travis-ci.com/ahmetonurslmz/smoothly-request)
[![Dependencies](https://david-dm.org/ahmetonurslmz/smoothly-request.svg)](https://david-dm.org/ahmetonurslmz/smoothly-request)
[![devDependencies](https://status.david-dm.org/gh/ahmetonurslmz/smoothly-request.svg?type=dev)](https://david-dm.org/ahmetonurslmz/smoothly-request)
[![install size](https://packagephobia.com/badge?p=smoothly-request)](https://packagephobia.com/result?p=smoothly-request)
[![npm version](https://badge.fury.io/js/smoothly-request.svg)](https://badge.fury.io/js/smoothly-request)Smoothly request
=============
Perform request with promise based client on NodeJSSmoothly request enables developer to send request with promise based client on NodeJS. The package generally was designed for cloud functions (aws lambda, google functions etc.), and it has a little unpacked size.
## Installing
Using npm:
```bash
$ npm install smoothly-request
```## Example
Performing a `GET` request
```js
const smoothlyRequest = require('smoothly-request');(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'GET'
});
})();
```Performing a `POST` request
```js
const smoothlyRequest = require('smoothly-request');(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users',
method: 'POST',
payload: {},
});
})();
```Performing `an another` request
```js
const smoothlyRequest = require('smoothly-request');(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'PATCH',
payload: {},
});
})();(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'DELETE',
payload: {},
});
})();
```