-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[![build](https://github.com/ideditor/country-coder/workflows/build/badge.svg)](https://github.com/ideditor/country-coder/actions?query=workflow%3A%22build%22) | ||
[![npm version](https://badge.fury.io/js/%40ideditor%2Fcountry-coder.svg)](https://badge.fury.io/js/%40ideditor%2Fcountry-coder) | ||
[![build](https://github.com/rapideditor/country-coder/workflows/build/badge.svg)](https://github.com/rapideditor/country-coder/actions?query=workflow%3A%22build%22) | ||
[![npm version](https://badge.fury.io/js/%40rapideditor%2Fcountry-coder.svg)](https://badge.fury.io/js/%40rapideditor%2Fcountry-coder) | ||
|
||
# country-coder | ||
|
||
|
@@ -56,17 +56,17 @@ Client-side coding has a number of benefits over server-side solutions: | |
|
||
### Use in Node | ||
|
||
`npm install @ideditor/country-coder` | ||
`npm install @rapideditor/country-coder` | ||
|
||
**country-coder** is distributed in CJS and ESM module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)) | ||
|
||
|
||
```js | ||
const countryCoder = require('@ideditor/country-coder'); // CommonJS import all | ||
const iso1A2Code = require('@ideditor/country-coder').iso1A2Code; // CommonJS import named | ||
const countryCoder = require('@rapideditor/country-coder'); // CommonJS import all | ||
const iso1A2Code = require('@rapideditor/country-coder').iso1A2Code; // CommonJS import named | ||
// or | ||
import * as countryCoder from '@ideditor/country-coder'; // ESM import all | ||
import { iso1A2Code } from '@ideditor/country-coder'; // ESM import named | ||
import * as countryCoder from '@rapideditor/country-coder'; // ESM import all | ||
import { iso1A2Code } from '@rapideditor/country-coder'; // ESM import named | ||
``` | ||
|
||
|
||
|
@@ -77,7 +77,7 @@ You can also use **country-coder** directly in a web browser. A good way to do t | |
When you load this file in a `<script>` tag, you'll get a `countryCoder` global to use elsewhere in your scripts: | ||
```html | ||
<head> | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/[email protected]/dist/country-coder.iife.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@rapideditor/[email protected]/dist/country-coder.iife.min.js"></script> | ||
</head> | ||
… | ||
<script> | ||
|
@@ -113,7 +113,7 @@ Read the [full API reference](#api-reference) to see everything `country-coder` | |
|
||
## Contributing | ||
|
||
This package is kept intentionally minimal. However, if you find a bug or have an interesting idea for an enhancement, feel free to open an [Issue](https://github.com/ideditor/country-coder/issues) and/or [Pull Request](https://github.com/ideditor/country-coder/pulls). | ||
This package is kept intentionally minimal. However, if you find a bug or have an interesting idea for an enhancement, feel free to open an [Issue](https://github.com/rapideditor/country-coder/issues) and/or [Pull Request](https://github.com/rapideditor/country-coder/pulls). | ||
|
||
|
||
## API Reference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/> | ||
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.js'></script> | ||
<script defer src='https://kit.fontawesome.com/c772610440.js' crossorigin='anonymous'></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/@ideditor/[email protected]/dist/country-coder.iife.min.js"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/@rapideditor/[email protected]/dist/country-coder.iife.min.js"></script> | ||
<!-- <script defer src='../dist/country-coder.iife.js'></script> --> | ||
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.css' rel='stylesheet'/> | ||
<link href='style.css' rel='stylesheet' type='text/css'/> | ||
|
@@ -63,7 +63,7 @@ | |
<div class='icon'><i class='fas fa-file-code fa-lg'></i></div> | ||
</div> | ||
<div id='octocat'> | ||
<a href='https://github.com/ideditor/country-coder' target='_blank'> | ||
<a href='https://github.com/rapideditor/country-coder' target='_blank'> | ||
<i class='fab fa-github fa-2x'></i> | ||
</a> | ||
</div> | ||
|
@@ -174,7 +174,7 @@ | |
|
||
window.addEventListener('DOMContentLoaded', function(e) { | ||
// Load the borders json | ||
fetch('https://cdn.jsdelivr.net/gh/ideditor/country-coder@main/src/data/borders.json') | ||
fetch('https://cdn.jsdelivr.net/gh/rapideditor/country-coder@main/src/data/borders.json') | ||
.then(function(response) { | ||
if (!response.ok) throw new Error(response.status + ' ' + response.statusText); | ||
return response.json(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters