adapting npm 1.2.5