Dependency injection consists of providing a function or class with its dependencies from the outside, instead of creating them inside. You can then substitute a double in tests and change implementation without modifying the calling code.
Example
function creerService(db) {
return { lire: (id) => db.trouver(id) };
}