DEV Community

Felippe Regazio
Felippe Regazio

Posted on

6

Why i created my own Express i18n Middleware to internationalize REST APIs

Yep, i created my ow Express i18n Middleware for REST APIs, and published it as a npm package. It has only 16kb, super easy usage, no-dependency and its well tested.

You can check the package on that link:
https://www.npmjs.com/package/express-rest-i18n

You can check the sources on that link:
https://github.com/felippe-regazio/express-rest-i18n

If you need to internationalize your REST API, you can consider use it, its FOSS. I have searching for some alternatives to REST APIs Internationalization and all of them (related to Express) where intended to be very general solutions, bringing a lot of built-in features that i didnt want to, or i simply disliked the API. So, i decided to write my own, the smaller and simplest as possible.

That made me think about something: The trade offs of creating very general tools VS a set of small single-purpose tools. I think this concern is not new, of course. We've been trying to solve this question in some different levels of development with module patterns, components, tree-shaking, graphs etc. So, this should be a packagist level question also, right? When you decide to start something, maybe you should ask yourself about this (?).

See, im not telling that the other tools i saw are bad or criticizing the options available, or telling that i created a better one, is not that. I dont even consider myself a good programmer as the guys that created such awesome tools like those i saw out there. My concern was purely: the weight of some modules to solve such small tasks on my project. Purely a trade off. Now, im just questioning how good or how bad can be to write a general VS single-purpose solutions.

🤔

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay