epayco / epayco-node

Node wrapper for Epayco API
https://epayco.co/docs/api/
30 stars 15 forks source link

Vanilla javascript #30

Closed damianham closed 2 years ago

damianham commented 2 years ago

Why is this dependent on Node if all it is doing is making sending requests to the API ?

It should be a plain vanilla javascript library so it can be used by any javascript framework e.g. a React website.

Gerson-epayco commented 2 years ago

Good Morning @damianham

JavaScript frameworks (React, Vue, Angular) are made in Nodejs, so this package works perfectly on them.

Greetings

damianham commented 2 years ago

Good morning Gerson.

That is a big fat No my friend. This package works for Nodejs only. For example it has a dependency on dotenv which requires fs module, e.g. // https://github.com/motdotla/dotenv/blob/master/lib/main.js const fs = require('fs') const path = require('path') const os = require('os') So my suggestion is to remove all unnecessary package dependencies and use vanilla javascript only that is independent of the environment in which it is used. Most of the work to do this should be limited to https://github.com/epayco/epayco-node/blob/master/lib/resources/index.js, e.g. ` require('dotenv').config(); // fs dependency /**

Gerson-epayco commented 2 years ago

Good morning @damianham

Your suggestion will be taken for future updates, although this package is meant to be used in backend

Greetings