countrycitystatejson is an MIT-licensed dataset and lookup API. Country records include states or provinces and their cities, keyed by name so corrections do not depend on integer ids.
npm install countrycitystatejson
npm · GitHub · MIT license