While there may not be a predefined method like Quaternion.FromToRotation for three.js, you can easily achieve the rotation from B to A with just a few lines of code.
import * as THREE from 'three';
const geometry = new THREE.SphereGeometry(1)
const material = new THREE.MeshBasicMaterial({ color: 0xffffff });
const sphere = new THREE.Mesh(geometry, material);
const vector_B = new THREE.Vector3(1,1,1).normalize();
const vector_A = new THREE.Vector3(0,0,1).normalize();
const n = vector_B.clone().cross(vector_A).normalize();
const theta = vector_B.angleTo(vector_A);
const q = new THREE.Quaternion(n.x * Math.sin(theta / 2), n.y * Math.sin(theta / 2), n.z * Math.sin(theta / 2), Math.cos(theta / 2));
sphere.applyQuaternion(q);
In this implementation, I made assumptions about the direction vectors B and A. By exploiting the mathematical relationship between these vectors, we derived the quaternion q that rotates from B to A based on their cross-product (represented by n) and the angle between them (denoted by theta).
const q = new THREE.Quaternion(n.x * Math.sin(theta / 2), n.y * Math.sin(theta / 2), n.z * Math.sin(theta / 2), Math.cos(theta / 2));