How send a message with socket from library.js (server side) to file.js(client side) without uid

library.js in the /nodebb-plugin-namePlugin
file.js in /nodebb-plugin-namePlugin/static/lib

Now I must do a lot of operation in my library.js and I must check when user is created. So I use the hook and It's everything ok, but, after I must my check in library I need to send a message to my file.js to change background color of a component. The proble is that I used this to communicate:

I don't believe you can do that since what you're asking for is using server side code on the client. To do that, the entire stack would need to be available on the client and everything it does. Basically running NodeBB on the client.
What you could do is set up your own socket and return the desired data that way.
In your library.js file:
const pluginSockets = require.main.require('./src/socket.io/plugins');
// This will add to the sockets object used by NodeBB core
pluginSockets.customFunc = ((socket, dataDoToFetch, done) => {
const response = 'This response is only a string but it can be whatever you want';
done(null, response);
});
Then client side:
socket.emit('plugins.customFunc', dataDoToFetch, (err, data) => {
if (err) console.log('My socket customFunc', err, data);
else console.log('Do stuff with this', data);
});
I cannot guarantee that this will work out of the box since my setup involves a bit more complexity, but this is the basic idea. Give it a shot!