You may hear the terms framework and library used interchangeably when talking about JavaScript tools. We will review guidelines you can use to judge whether to call something a framework or a library.
Why care about what you call a tool?
For the most part it should not make a huge difference if you call something a library or a framework. People will use either term to describe the same tool. However, there may be some individuals who feel very strongly about the correct usage of the term framework or library. Unfortunately, this does show up as a form of gatekeeping in some instances, and calling something by the wrong term can cause others to treat you as someone less knowledgable or skilled.
When is it a framework and when is it a library?
One good dividing line for determining what constitutes a framework and a library is how large the tool is. Generally, a library is likely a single package or piece of functionality and a framework pulls together multiple packages and pieces of functionality.
Another possible consideration is that frameworks often have whole ecosystems of supporting packages, tools, and plugins that you can pull into your project to add functionality. Libraries tend to be simpler and not have lively communities, even if they are very popular and widely used.
Examples of frameworks
- Angular
- React
- Vue.js
Examples of libraries
- lodash
- react (the actual single individual JavaScript package that provides core functionality for React)
- Angular CLI (the command line interface for Angular. It is a single separate tool for a single purpose that is part of the larger ecosystem. )