Fix: add tmp as well

 * refactor code to allow arbitrary directories for npm