open-index/open-npm huggingface dataset:
npm package: @rewindbitcoin/env
Description: This module centralizes shared configuration for all services and applications within the Rewind Bitcoin ecosystem. It is not intended for secrets.
Latest version: 33.0.0

# @rewindbitcoin/env

This module centralizes shared configuration for all services and applications
within the Rewind Bitcoin ecosystem. It is not intended for secrets.

## Usage

There are two primary ways to use this module:

1. **Directly**: Bash scripts and other processes can source `services.env`
directly to access configuration variables.

2. **Programmatically**: Node.js applications can use the `initEnv` function to
load the variables from `services.env` into the global `process.env` object.

This dual approach provides a unified and centralized way to manage shared
configurations across different parts of the system.
npm package: @rewindbitcoin/i18n
Description: Shared i18n tools for Rewind Bitcoin
Author: Jose-Luis Landabaso
Latest version: 2.0.0

# i18n

This package provides a simple way to manage your i18n (internationalization)
files for projects using `i18next` and `react-i18next`. It automates the
creation of a locales directory, the generation of an `init.ts` entry file and
a `locales.ts` file that aggregates all detected locales.

## Installation

To get started, install the necessary packages using `npm`:

```bash
npm install @rewindbitcoin/i18n --save-dev
npm install i18next@25 react-i18next@16
```

Packages `i18next@25` and `react-i18next@16` are the latest versions known to
work well with the code this tool generates. You should install them as
**regular dependencies** (not dev dependencies) in your project.

## Basic Usage

First, generate the initial locales folder and template files:

```bash
npx i18n_rewbtc
```

This command creates the `./i18n-locales` directory in your project root. Place
your translation files in this directory, using the `.js` format for each locale
(e.g., `en.js`, `es.js`).

After adding your translation files, run the command again to generate the
`init.ts` and `locales.ts` files:

```bash
npx i18n_rewbtc
```

These files are created in the `./i18n-locales` directory. `init.ts` serves as
the entry point for initializing `i18next` with your translations and
`locales.ts` exports an array of all locales you've provided.

## Importing Generated Files

You can import and use the generated `initReactI18next` function in your project
like this:

```typescript
import { initReactI18next } from './i18n-locales/init';
await initReactI18next('en'); // Initialize i18next with the 'en' locale
```

## Advanced Usage

If your project structure includes a specific source directory for your
translation files, you can specify this directory as an argument to the command:

```bash
npx i18n_rewbtc srcDirectory
```

Replace `srcDirectory` with the path to your source directory, relative to the
current working directory. This argument allows the tool to correctly locate
your translation files if they are not in the project root.

**Note:** If you provide an invalid directory or if the specified directory does
not exist, the command will throw an error.