A startup.jl for packages


#1

Suppose that you want to run some custom initialization code whenever a particular package is loaded. For example, perhaps you want to configure some display options for a plotting package.

The best solution I can think of is to define a function in startup.jl that uses @eval to load the package and run the initialization code. Is there a better way?


#2

Requires.jl?


#3

Isn’t this what the module __init__ function is for? Or by “you” you mean a user, not the package author?


#4

Yes, as the user.


#5

You can use callbacks, but I would just do it in the startup.jl as you describe.