# i18next-node-fs-backend

> node.js backend layer for i18next using fs module to load resources from filesystem

Latest version **2.1.3** (published 2019-04-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install i18next-node-fs-backend
pnpm add i18next-node-fs-backend
yarn add i18next-node-fs-backend
bun add i18next-node-fs-backend
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2019-04-09 |
| First published | 2015-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/i18next-node-fs-backend) |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 64 |
| Author | Jan Mühlemann |
| Maintainers | adrai, jamuhl |
| Keywords | i18next, i18next-backend |

## Links

- npm: https://www.npmjs.com/package/i18next-node-fs-backend
- Repository: https://github.com/i18next/i18next-node-fs-backend
- Issues: https://github.com/i18next/i18next-node-fs-backend/issues
- npm.io page: https://npm.io/package/i18next-node-fs-backend

## Dependencies (2)

- [json5](https://npm.io/package/json5.md) 2.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) 3.13.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

- 2.1.3 (latest) — 2019-04-09
- 2.1.2 — 2019-03-24
- 2.1.1 — 2018-12-10
- 2.1.0 — 2018-09-07
- 2.0.0 — 2018-08-17
- 1.2.1 — 2018-07-11
- 1.2.0 — 2018-07-11
- 1.1.0 — 2018-07-06
- 1.0.0 — 2017-04-30
- 0.1.3 — 2016-11-02
- 0.1.2 — 2016-03-21
- 0.1.1 — 2016-03-18
- 0.1.0 — 2016-03-16
- 0.0.6 — 2015-12-17
- 0.0.5 — 2015-12-15
- … 3 more at https://npm.io/package/i18next-node-fs-backend/versions

## README

# Introduction

[![Travis](https://img.shields.io/travis/i18next/i18next-node-fs-backend/master.svg?style=flat-square)](https://travis-ci.org/i18next/i18next-node-fs-backend)
[![Coveralls](https://img.shields.io/coveralls/i18next/i18next-node-fs-backend/master.svg?style=flat-square)](https://coveralls.io/github/i18next/i18next-node-fs-backend)
[![npm version](https://img.shields.io/npm/v/i18next-node-fs-backend.svg?style=flat-square)](https://www.npmjs.com/package/i18next-node-fs-backend)
[![David](https://img.shields.io/david/i18next/i18next-node-fs-backend.svg?style=flat-square)](https://david-dm.org/i18next/i18next-node-fs-backend)

This is a i18next backend to be used node.js. It will load resources from filesystem. Right now it supports following filetypes:

- .json
- .json5
- .yml
- .cson

# Getting started

Source can be loaded via [npm](https://www.npmjs.com/package/i18next-node-fs-backend).

```
$ npm install i18next-node-fs-backend
```

Wiring up:

```js
var i18next = require("i18next");
var Backend = require("i18next-node-fs-backend");

i18next.use(Backend).init(i18nextOptions);
```

As with all modules you can either pass the constructor function (class) to the i18next.use or a concrete instance.

## Backend Options

```js
{
  // path where resources get loaded from
  loadPath: '/locales/{{lng}}/{{ns}}.json',

  // path to post missing resources
  addPath: '/locales/{{lng}}/{{ns}}.missing.json',

  // jsonIndent to use when storing json files
  jsonIndent: 2,

  // custom parser
  parse: function(data) { return data; }
}
```

**hint** {{lng}}, {{ns}} use the same prefix, suffix you define in interpolation for translations!!!

Options can be passed in:

**preferred** - by setting options.backend in i18next.init:

```js
var i18next = require("i18next");
var Backend = require("i18next-node-fs-backend");

i18next.use(Backend).init({
  backend: options
});
```

on construction:

```js
var Backend = require("i18next-node-fs-backend");
var backend = new Backend(null, options);
```

by calling init:

```js
var Backend = require("i18next-node-fs-backend");
var backend = new Backend();
backend.init(options);
```

---

<h3 align="center">Gold Sponsors</h3>

<p align="center">
  <a href="https://locize.com/" target="_blank">
    <img src="https://raw.githubusercontent.com/i18next/i18next/master/assets/locize_sponsor_240.gif" width="240px">
  </a>
</p>

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