StableLib / stablelib

A stable library of useful TypeScript/JavaScript code
https://www.stablelib.com
Other
173 stars 35 forks source link

API Compatibility with base64-js (@stablelib/base64) #65

Closed WasabiThumb closed 9 months ago

WasabiThumb commented 11 months ago

This expands the exports of @stablelib/base64 to provide identical functionality to the base64-js package. This would allow developers to produce smaller bundles by using only 1 base64 impl when base64-js would otherwise be required by other packages, notably buffer.

  "dependencies": {
    "@stablelib/base64": "^1.0.2",
    "buffer": "^6.0.3"
  },
  "overrides": {
    "base64-js": "npm:@stablelib/base64@1.0.2"
  }
dchest commented 9 months ago

Thank you, but I think for this specific case, creating a separate compatibility package that imports this implementation and exports base64-js-like functions would be better (and you can host it and swap implementations as needed). It would be confusing to add aliases to this package.