Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Both folder vs lib folder meteor

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?

like image 540
Nate Avatar asked Aug 04 '14 13:08

Nate


People also ask

What is a lib folder?

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.

What is Lib folder used for?

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.

What should be in lib folder?

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.

Where is lib folder located?

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 .


1 Answers

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.

like image 108
Tarang Avatar answered Oct 30 '22 00:10

Tarang