Loading packages to the freshly added processes

I am trying to write the function that launches multithreaded processes and then pins the threads to the core.
The stripped down version looks like

using Distributed, ThreadPinning
function add_pinned_workers(nw::Int, nt::Int, coress)
    worker_list = addprocs(nw, exeflags=["--threads=$nt", "--project=$(Base.active_project())"])
    @sync for wid in worker_list
        @spawnat wid ThreadPinning.pinthreads(worker_list[wid-1])
    end 
end

Now, on a 8 core machine I can, for example, run add_pinned_workers(2,4, [[0,1,2,3],[4,5,6,7]]). However, this code does not execute, because ThreadPinning is not loaded on the newly added processes:

KeyError: key ThreadPinning [811555cd-349b-4f26-b7bc-1f208b848042] not found

Essentially, I need somehow to add ThreadPinning to the freshly spawned workers in the same function call. I have tried adding something like using ThreadPinning inside the function, but it is not allowed:

ERROR: LoadError: syntax: “using” expression not at top level

So, how to actually use “using” inside a function? Or do something similar in effect?

julia> function load_packages()
           @eval begin
               using Interpolations
           end
       end
load_packages (generic function with 1 method)

julia> load_packages()

julia> Interpolations
Interpolations

See Essentials · The Julia Language

You may also be interested in Distributed.@everywhere.

Thank you, guys.
If someone else is interested, the following code works:

using Distributed, ThreadPinning
function add_pinned_workers(nw::Int, nt::Int, coress)
    worker_list = addprocs(nw, exeflags=["--threads=$nt", "--project=$(Base.active_project())"])
    @eval @everywhere using ThreadPinning
    @sync for wid in worker_list
        @spawnat wid ThreadPinning.pinthreads(worker_list[wid-1])
    end 
end