@flyweight.cloud/request
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Flyweight Request

Tests

A tiny zero dependency library for Node.js designed for interacting with popular JSON API's

Why

This library is designed for use in serverless functions where the size of the codebase has a strong affect on cold start times.

Example

Basic POST Request

import { post } from '@flyweight.cloud/request'

const httpTrigger: AzureFunction = async function (context: Context, req: HttpRequest): Promise<void> {
    const resp = await post("https://httpbin.com/anything", {
        json: {
            some: "Data"
        },
        bearerToken: "MY_JWT_TOKEN"
    })
    context.res = {
        body: resp.json
    }
}

Testing

npm install
npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @flyweight.cloud/request

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

20.1 kB

Total Files

9

Last publish

Collaborators

  • mdp