Skip to content

Buffer type is deprecated in Node #764

@pjmolina

Description

@pjmolina

Description

Buffer type is deprecated in Node (See https://sindresorhus.com/blog/goodbye-nodejs-buffer). Provoking the following error:

✘ [ERROR] TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. [plugin angular-compiler]

    node_modules/fast-xml-parser/src/fxp.d.ts:409:26:
      409 │   parse(xmlData: string | Buffer ,validationOptions?: validationO...

Input / Context

Consume the library from a TS project.

Proposed Fix

Replace the Buffer type in file fast-xml-parser/src/fxp.d.ts:409:26 to be its super type: Uint8Array.

Would you like to work on this issue?

  • Yes. I will provide a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions