added npm support; minor amendments