open-index/open-npm huggingface dataset:
npm package: @memnrev/dict-builder
Description: Utility for building dictionaries object from dictionary text files
Latest version: 0.1.0

# @memnrev/dict-builder

Utility for building dictionaries object from dictionary text files.


## Usage Example

```typescript
const path = require('node:path');
const dictBuilder = require('@memnrev/dict-builder');

type Dictionary = {
  [dictName: string]: {
    [dictEntry: string]: string;
  };
};

const englishDictionary: Dictionary = dictBuilder({
  dictsFolder: path.resolve(__dirname, './src/dicts'),
  currLang: 'en',
});
```

## Creating Dictinaries

Create text files in a folder. File names (without extension) will become dictionary names.

E.g., file `global.txt`:

```text
[heading]
en: Hello, World!
ru: Привет!

[subHeading]
en: This is sub-heading.
ru: Это подзаголовок.
```

Text withing square brackets will become an entry key.

Use a dictionary entry in your code like this: `dict.global.heading`, `dict.global.subHeading`.
npm package: @memnrev/dict-loader
Description: Webpack loader for replacing dictionary entries with string literals
Latest version: 0.2.0

# dict-loader

Webpack loader for replacing dictionary entries with string literals.

The loader replaces entries of the form `dict.dictName.entryKey` in the code with string literals
found in dictionaries.

## Usage Example

```javascript
// webpack.config.js

const path = require('path');

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: [
          {
            loader: '@gorsoft/dict-loader',
            options: {
              dictsFolder: path.resolve(__dirname, './src/dicts'),
              currLang: 'en',
            },
          },
        ],
      },
    ],
  },
};
```

## Creating Dictinaries

Create text files in a folder. File names (without extension) will become dictionary names.

E.g., file `global.txt`:

```text
[heading]
en: Hello, World!
ru: Привет!

[subHeading]
en: This is sub-heading.
ru: Это подзаголовок.
```

Text withing square brackets will become an entry key.

Use a dictionary entry in your code like this: `dict.global.heading`, `dict.global.subHeading`.
npm package: @memnrev/dict-replacer
Description: Utility for replacing dictionary entries with string values in files
Latest version: 0.1.0

# @memnrev/dict-replacer

Utility for replacing dictionary entries with string values in files


## Usage Example

```javascript
const path = require('node:path');
const dictReplacer = require('@memnrev/dict-replacer');

const targetDir = path.resolve(__dirname, './en');
const dict = buildDictSomehow();

await dictReplacer(targetDir, dict);
```
npm package: @memnrev/eslint-config
Description: Shareable ESLint config
Latest version: 0.4.0

# @memnrev/eslint-config

Shareable ESLint config

## Installation

```bash
npm i --save-dev @memnrev/eslint-config
```

## Configurations

Node.js projects written in JavaScript:

```js
extends: "@memnrev/eslint-config/node"
```

Node.js projects written in TypeScript:

```js
extends: "@memnrev/eslint-config/node-ts"
```

React projects written in JavaScript:

```js
extends: "@memnrev/eslint-config/react-js"
```

React projects written in TypeScript:

```js
extends: "@memnrev/eslint-config/react-ts"
```
npm package: @memnrev/eslint-v9-config
Description: Shareable ESLint@9 config
Latest version: 0.4.0

# @memnrev/eslint-v9-config

Shareable ESLint v9 config.

Note: _For a sharebale ESLint v8 config use @memnrev/eslint-config._

## Installation

```bash
npm i --save-dev @memnrev/eslint-v9-config
```

## Configurations

Node.js projects written in TypeScript:

```js
// eslint.config.js

import mnrConfig from '@memnrev/eslint-v9-config';

export default [
  languageOptions: {
    parserOptions: {
      tsconfigRootDir: import.meta.dirname,
    },
  },
  ...mnrConfig.configs.node,
];
```

React projects written in TypeScript:

```js
// eslint.config.js

import mnrConfig from '@memnrev/eslint-v9-config';

export default [
  languageOptions: {
    parserOptions: {
      tsconfigRootDir: import.meta.dirname,
    },
  },
  ...mnrConfig.configs.react,
];
```

Base configuration already ignores `build` and `dist` folders.
npm package: @memnrev/request
Description: Memorize'n'revise request module
Latest version: 0.1.0

# @memnrev/request

Opinionated wrapper around [node-fetch](https://www.npmjs.com/package/node-fetch)




## You may not need it!

This is a custom, highly opinionated solution aimed at code re-use for a few private projects. You'd be better off using [node-fetch](https://www.npmjs.com/package/node-fetch) directly.



## Installation

```bash
$ npm install mnr-request --save
```





## Usage Examples

```javascript
const mnrRequest = require('mnr-request');

const apis = new Map([
  ['httpbin', {
    baseUrl: 'https://httpbin.org',
    apiOptions: {
      requestTimeoutMs: 5000,
      retries: 5,
      retryTimeoutMs: 500,
      customErrors: new Map([
        [401, { name: 'UnauthorizedError', message: 'request unauthorized' }]
      ])
    }
  }],
  ['example', { baseUrl: 'http://example.com' }]
]);

const globalOptions = {
  requestTimeoutMs: 10000,
  retries: 1,
  retryTimeoutMs: 3000,
  customErrors: new Map([
    [409, { name: 'ConflictError', message: 'request resulted in 409 Conflict response' }]
  ])
};


const request = mnrRequest(apis, globalOptions);

const responseData1 = request({
  apiName: 'httpbin',
  path: '/get',
  method: 'GET',
  headers: {
    'Authorization': 'Bearer 123foo='
  },
  qs: {
    foo: 'bar'
  }
});

const responseData2 = request({
  apiName: 'example',
  path: '/',
  method: 'PUT',
  body: {
    foo: 'bar'
  },
  requestOptions: {
    requestTimeoutMs: 0,
    retries: 0,
    retryTimeoutMs: 0,
    customErrors: new Map([
      [500, { name: 'CriticalError', message: 'backend is broken' }]
    ])
  }
});
```



## API Reference

`mnrRequest(apis, globalOptions)` - see JSDoc comments in `./index.js` file.

`request(opts)` - see JSDoc comments in `./lib/request.js` file.
npm package: @memnrev/request-data-validator
Description: Memorize'n'revise request data validation Express middleware
Latest version: 0.1.0

# @memnrev/request-data-validator

Memorize'n'revise request data validation Express middleware


Middleware does the following:

  1) if validation succeeds, extends Request object with property `requestData` that
contains validated and normalized request data;

  2) if validation fails, calls `next()` with an `InvalidRequestData` error.


## Installation

```bash
$ npm i --save @memnrev/request-data-validator
```