Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of lib directory in github repositories

Most of the time, when I look at projects in github , I see lib/ directory.

I just googled if there is a conventional meaning of lib/ directory. But I couldn't find much.

I would like to know what lib/ directory is for just to choose where to start looking at in github projects.

Project which have lib/ directories.

orchestrator

gulp

like image 710
FurkanO Avatar asked May 13 '16 22:05

FurkanO


People also ask

What does lib directory mean?

The lib folder is a library files directory which contains all helpful library files used by the system. In simple terms, these are helpful files which are used by an application or a command or a process for their proper execution. The commands in /bin or /sbin dynamic library files are located just in this directory.

What does the lib directory contain?

The /lib directory contains kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin. Libraries are readily identifiable through their filename extension of *. so.

What is Lib folder in Nodejs?

The lib folder is what package. json main points to, and users that install your package using npm will consume that directly.

What is lib directory in JS?

Directories. lib/ is intended for code that can run as-is. src/ is intended for code that needs to be manipulated before it can be used. build/ is for any scripts or tooling needed to build your project. dist/ is for compiled modules that can be used with other systems.


Video Answer


1 Answers

The lib directory, for most of my projects, is where I place shared components that might be used in multiple facets of my application. Things in this folder should not be tightly coupled to your application, and should theoretically be able to be plucked from one project to another, and work as expected (assuming all dependencies are available). Some examples of things I put in my lib folders:

  • If I'm defining a policy/process for loading bootstrapped data off the page into my frontend code, I would define the class/method in a file in the lib folder. It is just functional, and not bound to any of my application code or DOM structure.
  • If I need to build my own UI components (let's say I need to merge some Tagging functionality into a text area, and am unhappy with existing OSS alternatives), I would do it here. The code in lib just outlines how my component works, but doesn't implement any application-specific functionality. I can then include this in my core application and use it as if it were a third party library.

Essentially, anything that could be a third party dependency that you don't want to place in it's own repository and set up management for, you can use lib and have that functionality cleanly decoupled within your primary app.

like image 140
Mike Trpcic Avatar answered Oct 12 '22 16:10

Mike Trpcic