library vs framework vs package vs module
Library: code you call. Framework: code that calls you. Package: a distributable unit on a registry. Module: a single file inside a codebase.
library
Code you call. You are in control of the flow; you import the library and decide when and how to use its functions. Examples: Lodash, Pandas, Axios.
"import { format } from 'date-fns'; // you call the library when you need it"
framework
Code that calls you. The framework defines the structure and calls your code at the right moments (inversion of control). Examples: Django, Next.js, Spring.
"// Next.js calls your page component when a route is requested — you don't call Next.js"
package
A distributable unit of code published to a registry (npm, PyPI, Maven). A package can contain a library, a framework, a CLI tool, or anything else. It is about distribution, not about how you use it.
"npm install react // you install a package; inside it there is a library"
module
A single file or self-contained unit of code within a project. Every file you write is a module. Modules are about organization inside a codebase, not about distribution.
"import { validateEmail } from './utils/validators'; // utils/validators is a module"
Other comparisons
Ready to practice your English at work?
Lingua-e has interactive exercises built around real developer conversations: standups, code reviews, retrospectives, and more. Practice until it comes naturally.
Try Lingua-e for free