Numerical approximation of a general class of nonlinear unidirectional wave equations with a convolution-type nonlocality in space is considered. A semi-discrete numerical method based on both a uniform space discretization and the discrete convolution operator is introduced to solve the Cauchy problem. The method is proved to be uniformly convergent as the mesh size goes to zero. The order of convergence for the discretization error is linear or quadratic depending on the smoothness of the convolution kernel. The discrete problem defined on the whole spatial domain is then truncated to a finite domain. Restricting the problem to a finite domain introduces a localization error and it is proved that this localization error stays below a given threshold if the finite domain is large enough. For two particular kernel functions, the numerical examples concerning solitary wave solutions illustrate the expected accuracy of the method. Our class of nonlocal wave equations includes the Benjamin-Bona-Mahony equation as a special case and the present work is inspired by the previous work of Bona, Pritchard and Scott on numerical solution of the Benjamin-Bona-Mahony equation.