use new package.json `registry` property
still handle array main
Merge pull request #3 from guybedford/master

use new package.json `registry` property