Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 4, 2021
1 parent f0f8209 commit 8cfeaca
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 14 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @typedef {import('./iso6393.js').Type} Type
* @typedef {import('./iso6393.js').Scope} Scope
* @typedef {import('./iso6393.js').Language} Language
*/

export {iso6393} from './iso6393.js'
export {iso6393To1} from './iso6393-to-1.js'
export {iso6393To2B} from './iso6393-to-2b.js'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iso-639-3",
"version": "3.0.0",
"description": "ISO-639-3 codes in an accessible format",
"description": "Info on ISO 639-3",
"license": "MIT",
"keywords": [
"iso-639-3",
Expand Down
93 changes: 80 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,60 @@
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

[ISO 639-3][iso] codes in an accessible format, all of them.
Info on ISO 639-3.

## Install
## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`iso6393`](#iso6393)
* [`iso6393To1`](#iso6393to1)
* [`iso6393To2B`](#iso6393to2b)
* [`iso6393To2T`](#iso6393to2t)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains info on [ISO 639-3][iso].
ISO 639-3 is a set of codes that defines three letter identifiers for all known
human languages, whether living, extinct, ancient, historic, or constructed.

This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
## When should I use this?

You can use this package any time you have to deal with languages or ISO 639-3
in particular.

## Install

[npm][]:
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

```sh
npm install iso-639-3
```

In Deno with [Skypack][]:

```js
import {iso6393} from 'https://cdn.skypack.dev/iso-639-3@3?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
import {iso6393} from 'https://cdn.skypack.dev/iso-639-3@3?min'
</script>
```

## Use

```js
Expand Down Expand Up @@ -87,7 +128,7 @@ Object representing a language:
* `iso6391` (`string?`) — ISO 639-1 code
— ISO 639-1 code (example: `'en'`)

###### `Type`
#### `Type`

Category of a language:

Expand All @@ -110,7 +151,7 @@ Category of a language:
— non-language codes
(example: `und` for `Undetermined`)

###### `Scope`
#### `Scope`

Scope of a language:

Expand All @@ -126,18 +167,31 @@ Scope of a language:

### `iso6393To1`

`Object.<string, string>` — Object mapping ISO 639-3 code (`eng`) to ISO 639-1
codes (`en`).
Map of ISO 639-3 codes to ISO 639-1 codes (`Record<string, string>`).

### `iso6393To2B`

`Object.<string, string>` — Object mapping ISO 639-3 code (`eng`) to
bibliographic ISO 639-2 codes (`eng`).
Map of ISO 639-3 codes to bibliographic ISO 639-2 codes
(`Record<string, string>`).

### `iso6393To2T`

`Object.<string, string>` — Object mapping ISO 639-3 code (`eng`) to
terminologic ISO 639-2 codes (`eng`).
Map of ISO 639-3 codes to terminologic ISO 639-2 codes
(`Record<string, string>`).

## Types

This package is fully typed with [TypeScript][].

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

Expand All @@ -156,6 +210,11 @@ terminologic ISO 639-2 codes (`eng`).
* [`un-m49`](https://github.com/wooorm/un-m49)
— UN M49 codes

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]
Expand All @@ -180,10 +239,18 @@ terminologic ISO 639-2 codes (`eng`).

[npm]: https://docs.npmjs.com/cli/install

[skypack]: https://www.skypack.dev

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[iso]: https://iso639-3.sil.org

[language]: #language
Expand Down

0 comments on commit 8cfeaca

Please sign in to comment.