As I understand it in meteor you can have a both
folder along with a lib
folder. Both folders hold code that are pertinent to both the client and the server, such as iron-router routes or meteor collection definitions. Is there a difference between the two folders or are they the exact same thing?
lib is short for library which is often used for common files, utility classes, imported dependencies, or 'back in the days' also for dlls for (desktop) applications. It's in general a 'library' of supporting code for the core application.
This folder is for files that don't belong in the app folder (not controllers, helpers, mailers, models, observers or views), such as modules that are included into other areas of the application. The lib directory is for our code that won't 'fit' in the app directory.
lib – Application specific libraries. Basically, any kind of custom code that doesn't belong under controllers, models, or helpers. This directory is in the load path. That's not particularly helpful.
When you don't see the libs/ folder inside the app/ module, then you may have deleted the folder accidentally. You need to create a new libs/ folder by right-clicking on the app/ module, then select New > Directory from the context menu. Name the new directory as libs .
Both code would act as the same thing, just the lib
folder would have a preference with regard to loading order.
Files in the lib
directory would be loaded first, before the ones in the both
directory. This can be useful for helpers and constants and stuff you need to be ready before anything else loads.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With