Skip to content

Commit

Permalink
add es module usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
meikidd committed Aug 9, 2019
1 parent c463488 commit 90b76a4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,30 @@ npm install iso-639-1

### Node.js

```javascript
const ISO6391 = require('iso-639-1');
console.log(ISO6391.getName('en')); // 'English'
```
const ISO6391 = require('iso-639-1')
console.log(ISO6391.getName('en')) // 'English'

### ES Module

```javascript
import ISO6391 from 'iso-639-1';
console.log(ISO6391.getName('en')); // 'English'
```

### Browsers

HTML

```
```html
<script type="text/javascript" src="./node_modules/iso-639-1/build/index.js"></script>
```

Visit global variable ISO6391 in js

```
console.log(ISO6391.getName('en')) // 'English'
```javascript
console.log(ISO6391.getName('en')); // 'English'
```

## Methods
Expand Down Expand Up @@ -89,7 +96,7 @@ Check whether the given code is in the list of [ISO-639-1](https://en.wikipedia.

Get the array of the language objects by the given codes

## Usage
## Example

```
const ISO6391 = require('iso-639-1')
Expand Down

0 comments on commit 90b76a4

Please sign in to comment.