Skip to content

fix: remove safe-buffer dependency, use built-in Buffer#57

Closed
mahmoodhamdi wants to merge 1 commit intoauth0:masterfrom
mahmoodhamdi:fix/remove-safe-buffer
Closed

fix: remove safe-buffer dependency, use built-in Buffer#57
mahmoodhamdi wants to merge 1 commit intoauth0:masterfrom
mahmoodhamdi:fix/remove-safe-buffer

Conversation

@mahmoodhamdi
Copy link

Summary

  • Removed safe-buffer dependency from package.json
  • Replaced require('safe-buffer').Buffer with the built-in Buffer global in index.js and all test files
  • Buffer.from() and Buffer.alloc() are available natively in all supported Node.js versions (>=6), making safe-buffer unnecessary
  • This also fixes ESM bundling issues where safe-buffer's internal require("buffer") causes runtime errors

All tests pass.

Closes #55

The safe-buffer package was needed for Node.js versions <6 that lacked
Buffer.from() and Buffer.alloc(). All currently supported Node.js
versions include these APIs natively, making safe-buffer unnecessary.

This also fixes ESM bundling issues where safe-buffer's internal
require("buffer") causes runtime errors.

Closes auth0#55

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mahmoodhamdi
Copy link
Author

Closing — apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unnecessary safe-buffer dependency (use Node.js built-in Buffer API)

1 participant