# @tiny-i18n/fs

> The utilities about some actions dealing with i18n files.

Latest version **2.2.4** (published 2020-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tiny-i18n/fs
pnpm add @tiny-i18n/fs
yarn add @tiny-i18n/fs
bun add @tiny-i18n/fs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2020-07-05 |
| First published | 2018-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | imcuttle |
| Maintainers | moyuyc |

## Links

- npm: https://www.npmjs.com/package/@tiny-i18n/fs
- Repository: https://github.com/imcuttle/tiny-i18n
- Homepage: https://github.com/imcuttle/tiny-i18n#readme
- Issues: https://github.com/imcuttle/tiny-i18n/issues
- npm.io page: https://npm.io/package/@tiny-i18n/fs

## Dependencies (2)

- [pify](https://npm.io/package/pify.md) ^3.0.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.26.0

## Recent versions

- 2.2.4 (latest) — 2020-07-05
- 2.2.3 — 2020-07-04
- 2.2.2 — 2020-07-04
- 2.2.1 — 2020-07-04
- 2.2.0 — 2020-07-03
- 2.1.5 — 2020-07-03
- 2.1.4 — 2020-07-03
- 2.1.3 — 2020-07-03
- 2.1.2 — 2020-07-03
- 2.1.1 — 2020-07-03
- 2.1.0 — 2020-07-03
- 2.0.0 — 2020-07-03
- 1.1.2 — 2018-08-27
- 1.1.1 — 2018-08-27
- 1.1.0 — 2018-07-01
- … 3 more at https://npm.io/package/@tiny-i18n/fs/versions

## README

# @tiny-i18n/fs

[![NPM version](https://img.shields.io/npm/v/@tiny-i18n/fs.svg?style=flat-square)](https://www.npmjs.com/package/@tiny-i18n/fs)
[![NPM Downloads](https://img.shields.io/npm/dm/@tiny-i18n/fs.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/@tiny-i18n/fs)

The utilities about some actions dealing with i18n files.

## API
### new Fs(i18nRoot, options)
- Example
```javascript
const Fs = require('@tiny-i18n/fs')
new Fs(/* ... */)
```
### Options

- `force` **boolean** (default: `true`)
  Whether should insert an new record when the `key` is not found in dictionary.
- `quote` **enum('single', 'double')** (default: `'single'`)
  The dictionary quote's rule.

### Fs#getLanguages(): Promise<string[]>
Returns languages asynchronously.

In actual fact, The returned languages is readdir from `i18nRoot`.

- Example
```javascript
fs.getLanguages().then(console.log)
```

### Fs::getWordSync(key: string, lang: string): any
Returns raw words in matched key and in exact environment.

### Fs::getDictSync(lang: string): any
Returns dictionary in matched language.

### Fs::update(key: string, value: string, lang: string, options: Options): boolean

Updates value of matched key.

## Related
- [@tiny-i18n/express-live](../express-live) - The express router about tiny-i18n's edit live
- [@tiny-i18n/react-live](../react-live) - The magical effect making tiny-i18n could be used easily and edit live in react

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