diff --git a/examples/js-demo.js b/examples/js-demo.js new file mode 100644 index 0000000..4ff7642 --- /dev/null +++ b/examples/js-demo.js @@ -0,0 +1,22 @@ +//const tldEnum = require('tld-enum'); +const tldEnum = require('../formats/js/tld-enum'); + +console.log("There are " + tldEnum.tldList.length + " IANA TLDs"); + +let tldCheck; + +tldCheck = "com"; +console.log("Is '" + tldCheck + "' a real TLD?"); +if (tldEnum.tldList.indexOf(tldCheck) != -1) { + console.log(" yes"); +} else { + console.log(" no"); +} + +tldCheck = "somethingWeird"; +console.log("Is '" + tldCheck + "' a real TLD?"); +if (tldEnum.tldList.indexOf(tldCheck) != -1) { + console.log(" yes"); +} else { + console.log(" no"); +} \ No newline at end of file diff --git a/examples/php-demo.php b/examples/php-demo.php new file mode 100644 index 0000000..8f4f765 --- /dev/null +++ b/examples/php-demo.php @@ -0,0 +1,23 @@ +