├── .gitignore ├── Gruntfile.js ├── README.MD ├── dist └── js-country-code.min.js ├── package.json └── src └── js-country-code.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | node_modules 3 | 4 | *.swp 5 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 Garry Lachman garry@lachman.co under GNU LGPL 3 | https://rev.proxies.online 4 | This library is free software; you can redistribute it and/or modify it under the terms of the 5 | GNU Lesser General Public License version 2.1, as published by the Free Software Foundation. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 7 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | See the GNU Lesser General Public License for more details. 9 | 10 | based on https://github.com/hannesgassert/countrynames 11 | */ 12 | 13 | module.exports = function(grunt) { 14 | 15 | var header = "Copyright (C) 2016 Garry Lachman garry@lachman.co under GNU LGPL\n"+ 16 | "https://rev.proxies.online\n"+ 17 | "This library is free software; you can redistribute it and/or modify it under the terms of the\n"+ 18 | "GNU Lesser General Public License version 2.1, as published by the Free Software Foundation.\n"+ 19 | "This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n"+ 20 | "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"+ 21 | "See the GNU Lesser General Public License for more details.\n\n"; 22 | 23 | grunt.initConfig({ 24 | pkg: grunt.file.readJSON('package.json'), 25 | uglify: { 26 | options: { 27 | banner: '/*! '+header+'<%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' 28 | }, 29 | build: { 30 | src: 'src/<%= pkg.name %>.js', 31 | dest: 'dist/<%= pkg.name %>.min.js' 32 | } 33 | } 34 | }); 35 | 36 | grunt.loadNpmTasks('grunt-contrib-uglify'); 37 | 38 | grunt.registerTask('default', ['uglify']); 39 | }; 40 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | #JavaScript Country Code 2 | map from country codes to country names and vice versa. 3 | based on https://github.com/hannesgassert/countrynames 4 | 5 | Copyright (C) 2016 Garry Lachman under GNU LGPL 6 | 7 | https://rev.proxies.online 8 | 9 | 10 | ##Using 11 | ``` 12 | var country = new CountryCode(); 13 | country.getCode("united states"); 14 | country.getName("us"); 15 | ``` 16 | 17 | ##Licence 18 | Copyright (C) 2016 Garry Lachman 19 | 20 | This library is free software; you can redistribute it and/or 21 | modify it under the terms of the GNU Lesser General Public 22 | License version 2.1, as published by the Free Software Foundation. 23 | 24 | This library is distributed in the hope that it will be useful, 25 | but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 27 | Lesser General Public License for more details. -------------------------------------------------------------------------------- /dist/js-country-code.min.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (C) 2016 Garry Lachman garry@lachman.co under GNU LGPL 2 | https://rev.proxies.online 3 | This library is free software; you can redistribute it and/or modify it under the terms of the 4 | GNU Lesser General Public License version 2.1, as published by the Free Software Foundation. 5 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 6 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 7 | See the GNU Lesser General Public License for more details. 8 | 9 | js-country-code 2016-04-21 */ 10 | !function(){function a(){this.fromName={},this.fromCode={};var a=Object.keys(b);for(i=0;i