modified for npm package.