Eexpressjs

expressjs/pluralize-method-names

Migrates usage of deprecated singular request methods to their pluralized versions in Express.js applications.

transformationmigrationexpressacceptsaccepetsCharsetsacceptsEncodingsacceptsLanguages
Public
0 executions
2 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Migrate pluralized request methods

Migrates deprecated request methods to their pluralized versions that were deprecated in Express 4 and removed in Express 5.

Example

Migrating req.acceptsCharset(charset)

The migration involves replacing instances of req.acceptsCharset(charset) with req.acceptsCharsets(charset).

diff

Migrating `req.acceptsEncoding(encoding)

The migration involves replacing instances of req.acceptsEncoding(encoding) with req.acceptsEncodings(encoding).

diff

Migrating req.acceptsLanguage(language)

The migration involves replacing instances of req.acceptsLanguage(language) with req.acceptsLanguages(language).

diff

References

Ready to contribute?

Build your own codemod and share it with the community.