What is the lib/ or library/ directory for? [closed]

I’m considering having a lib/ directory in my source code.

From what I understand it’s basically a junk draw where all the code lives which isn’t view related? It seems like a very generic name to me. Could it refer to an internal library created by the project which could be then open sourced and used in any project?

I’ve seen it in iOS development and ruby development too.

Ideally somebody could layout what lib/ means in a number of frameworks / languages / platforms so I could get a sense of what it generally means.


  • Ruby on rails: …
  • Unix: …
  • iOS: …


The lib/ directory is typically an abbreviation for “library”. What the word library means will depend on the tech stack and framework, but in my experience the lib/ folder contains these kinds of files:

  • Third-party dependencies developed outside your organization.
  • Dependencies developed by other teams in your organization.
  • Pre-compiled binaries

Basically, the lib/ folder tends to be a catch-all for application dependencies whose development is outside the scope of the current application. This could include source code files, static assets or compiled binaries.

This folder could just as easily be called “dependencies”.


Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *