Settings

Theme

Show HN: Fetchbook – Run and test your HTTP requests 100% locally

github.com

59 points by 4lejandrito 2 years ago · 9 comments

Reader

loa_in_ 2 years ago

This project, for someone like me who hasn't touched typescript in a year or two looks like great example/refresher to just read through. It's very nicely written and works just as advertised. The inputs/ configs/ FetchStories are elegant.

As a cli tool to support testing of endpoints: very nicely contained and concise.

As a library for use in test code: I'm yet to try and use it this way but looks fun to use!

  • 4lejandritoOP 2 years ago

    Thanks for the kind words.

    So far fetchbook only works as a cli. I have not yet found a use case for it to also work as a library.

twodave 2 years ago

Interesting!

I have built a similar tool, but more geared toward speed and CI/CD pipelines (check my submission history if you really want to know, don't want to detract from this project in any Way).

This looks like a very "scratching your own itch" sort of a project. What led you to build this? Why does this meet your needs while other things have failed (to the point that you decided to build your own)?

  • 4lejandritoOP 2 years ago

    Hi! I checked your tool (https://naprun.dev) and it follows the same philosophy, I like it. However the reasons why I decided to build my own one are:

    1. I love building things, I can't help it.

    2. I don't enjoy using markup languages mainly because of lack of autocomplete and difficulty to support more complex use cases. By using typescript fetchbook suddenly inherits all it's powers and can be more easily customized.

    3. By piggybacking on top of the Request Web API (https://developer.mozilla.org/en-US/docs/Web/API/Request), I don't have to define custom ways to define requests. Also if you know how do fetch on JS/TS you can grasp fetchbook in less than 5 minutes.

    Oh and fetchbook is also ready to be used in CI, I run tests for fetchbook in GitHub actions, which are actually fetchbook stories themselves.

sibeliuss 2 years ago

Props on using Bun!

  • 4lejandritoOP 2 years ago

    I've come to realize how cool bun is when building fetchbook. I couldn't have used typescript as the main language so easily without it. I am very happy with it so far.

    • leetrout 2 years ago

      > I couldn't have used typescript as the main language so easily without it.

      I am very skeptical of this. Could you convince with me with more specific details?

      • 4lejandritoOP 2 years ago

        I've used ts-node before to run Typescript and my experience has been good, I've generally managed to do what I wanted. However with ts-node the speed is low (specially startup time) and I've always had problems with different module formats, dependencies etc. With bun everything just worked and it is so fast.

        I cannot say that fetchbook would not have been possible without bun, but I am fairly confident it would not have taken me 3 days from idea to this HN comment.

        Maybe give it a go?

        Edit: maybe using deno would have been as easy... but I chose to try bun and I felt in love with it instantly.

      • sibeliuss 2 years ago

        Typescript _is_ easy to setup and use these days, but whats the point of setup when you can run bun and it just works perfectly instantly with zero setup?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection