UNPKG

typed-usa-states

Version:

An array of geographical data for all USA states with full TypeScript support

52 lines (45 loc) 1.47 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Typed USA States</title> <!-- Include the Require JS library from CDNJS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous" ></script> </head> <body> <div id="result"></div> <script> // This is the most important part var exports = {}; // Require the needed files require([ '../dist/cities.js', '../dist/states-full.js', '../dist/states-with-area.js', '../dist/states-with-counties.js', '../dist/states-with-population.js', '../dist/states-with-zipcodes.js', '../dist/states.js' ], function () { var html = ''; // The exports object from above gets populated console.log(exports.usaCities); console.log(exports.usaStates); console.log(exports.usaStatesFull); console.log(exports.usaStatesWithArea); console.log(exports.usaStatesWithCounties); console.log(exports.usaStatesWithPopulation); console.log(exports.usaStatesWithZipCodes); Object.keys(exports).forEach(function (key) { html += key + ': ' + exports[key].length + ' items<br>'; }); document.getElementById('result').innerHTML = html; }); </script> </body> </html>