slightly customised for npm