# iso-639-1

> ISO-639-1 codes

Latest version **3.1.6** (published 2026-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso-639-1
pnpm add iso-639-1
yarn add iso-639-1
bun add iso-639-1
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.1.6 |
| Published | 2026-07-02 |
| First published | 2015-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0 |
| Dependencies | 0 |
| Unpacked size | 39.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 221 |
| Author | meikidd |
| Maintainers | meikidd |
| Keywords | iso, iso-639, iso-639-1, language, language code, locale, locale code |

## Links

- npm: https://www.npmjs.com/package/iso-639-1
- Repository: https://github.com/meikidd/iso-639-1
- Homepage: https://github.com/meikidd/iso-639-1#readme
- Issues: https://github.com/meikidd/iso-639-1/issues
- npm.io page: https://npm.io/package/iso-639-1

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 3.1.6 (latest) — 2026-07-02
- 1.0.1 (beta) — 2015-12-17
- 3.1.5 — 2025-02-05
- 3.1.4 — 2025-01-15
- 3.1.3 — 2024-08-27
- 3.1.2 — 2024-02-20
- 3.1.1 — 2024-02-16
- 3.1.0 — 2023-09-11
- 3.0.1 — 2023-08-24
- 3.0.0 — 2023-08-18
- 2.1.15 — 2022-06-10
- 2.1.14 — 2022-06-01
- 2.1.13 — 2022-02-08
- 2.1.12 — 2022-01-20
- 2.1.11 — 2021-12-07
- … 29 more at https://npm.io/package/iso-639-1/versions

## README

# ISO-639-1
[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Download Count][download-url]][npm-url]

[travis-image]: https://travis-ci.org/meikidd/iso-639-1.svg?branch=master
[travis-url]: https://travis-ci.org/meikidd/iso-639-1
[npm-image]: https://img.shields.io/npm/v/iso-639-1.svg?style=flat-square
[npm-url]: https://npmjs.org/package/iso-639-1
[download-url]: https://img.shields.io/npm/dt/iso-639-1.svg?style=flat-square


Simple interface for [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes

## Installation

```
npm install iso-639-1
```

## Usage

### Node.js

```javascript
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

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

## Methods

### getName(code)
  - @param code {string}
  - @return {string}

Lookup language english name by code

### getAllNames()
  - @return {array}

Get array of all language english names

### getNativeName(code)
  - @param code {string}
  - @return {string}

Lookup language native name by code

### getAllNativeNames()
  - @return {array}

Get array of all language native names


### getCode(name)
  - @param name {string}
  - @return {string}

Lookup code by english name or native name

### getAllCodes()
  - @return {array}

Get array of all codes

### validate(code)
  - @param code {string}
  - @return {boolean}

Check whether the given code is in the list of [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)

### getLanguages(codes)
  - @param codes {array}
  - @return {array}

Get the array of the language objects by the given codes

## Example

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

console.log(ISO6391.getName('zh')) // 'Chinese'
console.log(ISO6391.getNativeName('zh')) // '中文'

console.log(ISO6391.getAllNames()) // ['Afar','Abkhaz', ... ,'Zulu']
console.log(ISO6391.getAllNativeNames()) //['Afaraf','аҧсуа бызшәа', ... ,'isiZulu' ]

console.log(ISO6391.getCode('Chinese')) // 'zh'
console.log(ISO6391.getCode('中文')) // 'zh'

console.log(ISO6391.getAllCodes()) //['aa','ab',...,'zu']

console.log(ISO6391.validate('en')) // true
console.log(ISO6391.validate('xx')) // false

console.log(ISO6391.getLanguages(['en', 'zh']))
// [{code:'en',name:'English',nativeName:'English'},{code:'zh',name:'Chinese',nativeName:'中文'}]

```

---
_Source: https://npm.io/package/iso-639-1 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
