> ## Documentation Index
> Fetch the complete documentation index at: https://stars-components.js.org/llms.txt
> Use this file to discover all available pages before exploring further.

# @wolfstar/i18next-backend

> Load and merge i18next resources from the filesystem.

<CodeGroup>
  ```bash npm theme={"system"}
  npm install @wolfstar/i18next-backend
  ```

  ```bash pnpm theme={"system"}
  pnpm add @wolfstar/i18next-backend
  ```

  ```bash yarn theme={"system"}
  yarn add @wolfstar/i18next-backend
  ```

  ```bash bun theme={"system"}
  bun add @wolfstar/i18next-backend
  ```
</CodeGroup>

<CardGroup cols={2}>
  <Card title="npm" icon="npm" horizontal href="https://npmx.dev/package/@wolfstar/i18next-backend" />

  <Card title="Source" icon="github" horizontal href="https://github.com/wolfstar-project/stars-components/tree/main/packages/i18next-backend" />
</CardGroup>

## Description

A fast and modern filesystem-based [`i18next`](https://www.npmjs.com/package/i18next) backend for Node.js.

## Usage

```typescript theme={"system"}
import { Backend } from '@wolfstar/i18next-backend';
import i18next from 'i18next';

i18next.use(Backend);

await i18next.init({
	backend: {
		paths: [
			// Using a string:
			'/locales/{{lng}}/{{ns}}.json',
			// Using an URL:
			new URL('/locales/{{lng}}/{{ns}}.json', import.meta.url),
			// Using a function:
			(lng, ns) => `/locales/${lng}/${ns}.json`
		]
	}
	// ... i18next options
});
```
