Giter Club home page Giter Club logo

cowl's Introduction

Perry Mitchell

Aussie programmer, based in Finland. Specialising in web, mobile and systems development: Javascript, Typescript, React, Terraform, Objective-C.

Github contributions Github stats Github commits by hour

โšก Social: Mastodon / Keybase

๐Ÿ” Buttercup: buttercup.pw / GitHub / Keybase

NPM Downloads

cowl's People

Contributors

perry-mitchell avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jayd2446

cowl's Issues

Add a "migrating from fetch" guide

I'm looking at cowl in relation to buttercup/buttercup-core#229, and it is tough to know the best way to migrate from fetch. It's also tough to know what the advantages are of cowl over fetch from the readme.

Here are the possible options for fetch.

    method: 'POST', // *GET, POST, PUT, DELETE, etc.
    mode: 'cors', // no-cors, *cors, same-origin
    cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
    credentials: 'same-origin', // include, *same-origin, omit
    headers: {
      'Content-Type': 'application/json'
      // 'Content-Type': 'application/x-www-form-urlencoded',
    },
    redirect: 'follow', // manual, *follow, error
    referrer: 'no-referrer', // no-referrer, *client
    body: JSON.stringify(data) // body data type must match "Content-Type" header

As I understand it, mode, cache, credentials, redirect, and referrer do not have analogs in cowl. Is this correct?

For responses, the API seems pretty straightforward, with the only difference that cowl stores the body in a buffer and that it does not automatically parse the body given the response type.

Also, fetch has some logic under the hood to do things like guess the Content-Type and Content-Length - are these present in cowl?

In general, what would be the main advantages of using cowl over fetch? Because fetch is battle-tested, has very few bugs, and will be known by most new contributors to a JS project, one would need IMO a pretty compelling reason to migrate to something new. Not saying that cowl lacks this, but rather that it is not apparent what the advantages are when reading the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.