telegra.ph icon indicating copy to clipboard operation
telegra.ph copied to clipboard

General Improvements

Open GodBleak opened this issue 1 year ago • 0 comments

I've found several improvements I think this library could benefit from:

  • Switch (fully) to TypeScript: Moving the entire codebase to TypeScript would enhance type safety, improve developer experience, and align with modern TypeScript practices.

  • Use JSDoc: Having to constantly refer to the online docs can be a pain, so I think it would be beneficial to use JSDoc to get documentation in the editor.

  • Allow Dependency Injection for the HTTP Client: Offering the flexibility to inject any preferred HTTP client seems like a smart move. It opens up options for different use cases and preferences.

  • Ditch isomorphic-fetch: Given its lack of active maintenance and unresolved security advisories, replacing isomorphic-fetch with a more reliable solution would improve the security and reliability of the library.

  • Use Built-in Modules as the Default HTTP Client: Using Node.js' built-in modules like HTTPS or Fetch as the default HTTP client would reduce external dependencies, which would minimize potential security vulnerabilities.

  • Adopt Modern ECMAScript Standards over CommonJS: Transitioning to ECMAScript modules (ESM) would modernize the codebase.

I think these modifications would greatly improve the library's usability and security.

GodBleak avatar Nov 13 '23 18:11 GodBleak