We present a prescription for performing electronic-structure calculations without the explicit use of a basis. Our prescription combines a higher-order finite-difference method with ab initio pseudopotentials. In contrast to methods that combine a plane-wave basis with pseudopotentials, our calculations are performed completely in real space. No artifacts such as supercell geometries need be introduced for localized systems. Although this approach is easier to implement than one that employs a plane-wave basis, no loss of accuracy occurs. We apply this method to calculate the structural and electronic properties of several diatomic molecules: Si2, C2, O2, and CO.