deepl-node icon indicating copy to clipboard operation
deepl-node copied to clipboard

Remove Axios dependency

Open MickL opened this issue 10 months ago • 2 comments

Consider removing Axios in favor native fetch. Personally I would recommend to use unjs/ofetch which works in all environments (node, browser, worker).

Motivation:

  • Bundle size: In serverless environments, and especially on edge workers, every kb counts and deepl-node is adding another unnecessary library by using Axios
  • deepl-node doesnt work on the edge: Axios is not working on non-node environments (without use of fetch adapter), this would resolve #64
  • Using fetch, e.g. with ofetch as a wrapper, makes deepl-node work on all Node-like environments like Deno, Bun, Cloudflare Workers, etc.

Possibly with this refactoring a second package could be added that is independent from node, e.g. by removing things like fs. This package could then be used by deepl-node as a base.

MickL avatar Feb 18 '25 16:02 MickL