cities-json 0.6.8

Get cities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const fs = require('fs/promises');
const jsonfile = require('jsonfile');

const assertParseable = async (jsonFilename) => {
  // assert it can parse the file with native json parsing function
  const jsonString = await fs.readFile(jsonFilename, { encoding: 'utf8' });
  JSON.parse(jsonString);

  // assert it can parse the file with the jsonfile library
  jsonfile.readFileSync(jsonFilename);
};

(async () => {
  assertParseable('cities.json');
  assertParseable('admin1.json');
  assertParseable('admin2.json');
})();