# 18n

> A simple i18n module

Latest version **0.0.1** (published 2018-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install 18n
pnpm add 18n
yarn add 18n
bun add 18n
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-09-08 |
| First published | 2018-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | LitoMore |
| Maintainers | litomore |
| Keywords | i18n |

## Links

- npm: https://www.npmjs.com/package/18n
- Repository: https://github.com/LitoMore/18n
- Homepage: https://github.com/LitoMore/18n#readme
- Issues: https://github.com/LitoMore/18n/issues
- npm.io page: https://npm.io/package/18n

## Dependencies (1)

- [pkg-dir](https://npm.io/package/pkg-dir.md) ^3.0.0

## 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

- 0.0.1 (latest) — 2018-09-08

## README

# 18n

A simple i18n module

## Install

```bash
$ npm install 18n
```

## Usage

`18n` will read the configuration from the `18n.config.js` in your package root.

### Configuration

```javascript
// 18n.config.js
module.exports = {
  langPath: 'languages',
  langPacks: [
    'en-us',
    'zh-cn'
  ],
  selector: () => {
    const {language} = navigator;
    switch (language) {
      case 'zh':
      case 'zh-cn':
        return 'zh-cn';
      default:
        return 'en-us';
    }
  }
};
```

## License

MIT © [LitoMore](https://github.com/LitoMore)

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