What makes a great Node.js Open-Source library?
As developers, we often ponder questions like, “This looks great, let's create a library,” or “Why does this library work this way? I want it to behave differently.” While these thoughts can spark motivation, they don't always lead to a successful open-source library. Publishing a library is easy; maintaining it and ensuring its relevance is the real challenge. Let's explore lessons learned from the Ackee Backend team’s journey in open-source, how we improved our libraries, and when you should consider starting your project.
Open Source Maintenance
The first question is: “Do I have the time and expertise to maintain this?” Open-source projects often operate like charities — sustained by unpaid labor. Many projects fail because developers lack time, lose interest, or move on. Our team faced this issue head-on.
Over the years, we created numerous libraries, but by the start of this year, we didn’t even know how many we had or when they were last updated. Many libraries were outdated, and some contained vulnerabilities or lacked compatibility with newer Node.js versions. To resolve this, we needed to commit to better care.
Avoiding Reinventing the Wheel
Popular open-source libraries often come with years of development and carefully considered design decisions. Before creating your solution, always investigate why existing libraries are designed the way they are. Review documentation, browse GitHub issues, or reach out to maintainers.
Think of launching a library like launching a product: What are the use cases? What value does it bring? What sets it apart? With over 3 million packages in the npm registry as of 2023, the world doesn’t need another clone of an existing solution.
If an existing library lacks a feature you need, consider contributing to it via a pull request or creating a wrapper around it. However, be cautious — track changes in the original library to avoid redundancy. This was also the case with one of our open-source Cosmas, a Pino-based logger.
Open Source: Flexibility vs. Abstraction
Locking users into a specific tech stack or overcomplicating an abstraction can be counterproductive. At Ackee, we’ve learned that less is often more and flexibility is very important.
Take database manipulation tools, for example. We’ve worked with Sequelize, TypeORM, Bookshelf, Knex, Prisma, Kysely and we even developed our open-source library called Databless (now deprecated). On larger projects, complex queries and database optimizations exposed the limitations of high-level ORMs. Query builders like Knex and Kysely proved to be more flexible, easier to optimize, and closer to SQL’s native syntax.
This lesson applies broadly: High abstraction saves time initially but complicates long-term development, especially when refactoring or swapping technologies. Many of our deprecated libraries - email, unicore, or fuqu wrapped existing technologies but lacked full feature support, making them hard to maintain and limiting the use cases.
Sustainability and Responsibility
Once you’ve defined your idea and are ready to commit, ask yourself: “How will I ensure ongoing support?”
We’ve moved away from assigning a single person to maintain a library. People’s priorities and enthusiasm change, and replacing a dedicated maintainer is difficult. Instead, we share responsibility across the team. Here’s how:
- We track all issues and feature requests on GitHub.
- Monthly meetings ensure we review and assign tasks based on team preferences.
- Knowledge is shared across the team to avoid bottlenecks and ensure continuity.
If no immediate tasks exist, we brainstorm new features or evaluate improvements. This collective approach reduces the risk of forgotten libraries we had.
Knowing When to Let Go
Not every idea will succeed, and that’s okay. Don’t be afraid to deprecate projects that no longer serve their purpose. Open-source is about experimentation and growth, and even abandoned projects can provide valuable learning experiences.
This year, we retired several libraries, freeing us to focus on projects we’re passionate about and capable of maintaining. Here’s our curated list of active open-source projects:
- Configuru and its VS Code extension - Simplify Tzpescript app configuration with env or JSONC files including validation.
- Node-healthz - Effortless health checks for your app
- OTPass - Generate TOTP and HOTP one-time passwords without Node.js dependencies.
- Kesha - Simple tools to enhance your experience with ioredis.
- styleguide-backend-config - ESLint and Prettier configurations we love
- create-node-app - A minimal-effort template for Google Cloud Node.js apps
Good Luck with Your Open-Source Journey!
We hope these insights inspire and guide you in your open-source endeavors. Remember, the true beauty of open-source lies in collaboration!