open-index/open-npm huggingface dataset:
npm package: @robinblomberg/debug
Description: Simple `console` alternative that adds an icon and a color to your terminal messages.
Author: Robin Blomberg
Latest version: 0.3.0

# Debug

Simple `console` alternative that adds an icon and a color to your terminal messages.

## Installation

```sh
npm install @robinblomberg/debug
```

## Usage

```js
debug('Debug');
// 'Debug'

debug.error('Error');
// '✗ Error'

debug.info('Info');
// '• Info'

debug.success('Success');
// '✓ Success'

debug.warn('Warn');
// '⚠ Warn'
```
npm package: @robinblomberg/eslint-config-prettier
Description: ``` npm install --save-dev @robinblomberg/eslint-config-prettier ```
Author: Robin Blomberg
Latest version: 0.1.4

# ESLint Config for Prettier

## Installation

```
npm install --save-dev @robinblomberg/eslint-config-prettier
```

## Configuration

In your **.eslintrc.json**:

```javascript
{
  "extends": [
    "@robinblomberg/robinblomberg",
    "@robinblomberg/prettier"
  ]
}
```
npm package: @robinblomberg/eslint-config-robinblomberg
Description: ```sh npm install -D @robinblomberg/eslint-config-robinblomberg ```
Author: Robin Blomberg
Latest version: 0.32.0

# ESLint config

## Installation

```sh
npm install -D @robinblomberg/eslint-config-robinblomberg
```

## Configuration

Create a file called **.eslintrc.js** at the project root:

```js
module.exports = {
  extends: '@robinblomberg/robinblomberg',
};
```

## NPM scripts

Add the following scripts to your package.json:

```json
{
  "scripts": {
    "lint-scripts": "eslint \"**/*.{js,jsx,ts,tsx}\"",
    "lint-scripts-fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix"
  }
}
```

Adjust the paths according to your project/file structure as necessary (e.g. `"eslint \"lib/**/*.{ts,tsx}\""`).

To run a script, enter the following in your command line:

```sh
npm run lint-scripts
```

## Formatting on save

With this knowledge of ESLint messages in mind, we can modify VS Code to tell ESLint to fix any issues (mainly formatting) every time we save. To open the settings menu, click on the gear icon in the lower left, and then choose **Settings**.

Within the settings menu, search for eslint. In the results, you will see a checkbox for **ESLint: Auto Fix on Save**. Make sure this is checked:

![VS Code Settings](./docs/images/mycmb9lgf1joqvp6r9jq.png)

Now, save your JavaScript file. You should see some changes, including fewer squiggles.
npm package: @robinblomberg/express-async-handler
Description: Simple middleware for handling exceptions inside of async express routes and passing them to your express error handlers.
Author: Robin Blomberg
Latest version: 1.1.0

# Express async handler

Simple middleware for handling exceptions inside of async express routes and passing them to your
express error handlers.

## Installation

```sh
npm install @robinblomberg/express-async-handler
```

## Usage

```js
import { asyncHandler } from '@robinblomberg/express-async-handler';

express.get(
  '/',
  asyncHandler(async (req, res, next) => {
    const bar = await foo.findAll();
    res.send(bar);
  }),
);
```
npm package: @robinblomberg/http-status
Description: Enumeration of all HTTP statuses and status texts.
Author: Robin Blomberg
Latest version: 1.3.0

# HTTP status

Enumeration of all HTTP statuses and status texts.

## Installation

```sh
npm install @robinblomberg/http-status
```

## Usage

```js
import { status } from '@robinblomberg/http-status';

status.clientError.BAD_REQUEST;
// 400

statusText[status.clientError.BAD_REQUEST];
// 'Bad Request'
```
npm package: @robinblomberg/prettier-config
Description: ```sh npm install -D @robinblomberg/prettier-config ```
Author: Robin Blomberg
Latest version: 0.2.0

# Prettier config

## Installation

```sh
npm install -D @robinblomberg/prettier-config
```

## Configuration

Create a file called **.eslintrc.js** at the project root:

```js
module.exports = {
  extends: '@robinblomberg/robinblomberg'
}
```

## NPM scripts

Add the following scripts to your package.json (assuming that ESLint is enabled):

```json
{
  "scripts": {
    "format:scripts": "prettier --write src/**/*.{ts,tsx,js,jsx} && eslint src/**/*.{ts,tsx,js,jsx} --fix",
  }
}
```

Adjust the paths according to your project/file structure as necessary.

To run a script, enter the following in your command line:

```sh
npm run format:scripts
```

## VS Code settings

Add the following to **.vscode/settings.json** in the root of your project:

```json
{
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.insertSpaces": true,
  "editor.rulers": [100],
  "editor.tabSize": 2,
  "eslint.format.enable": false,
  "files.encoding": "utf8",
  "files.eol": "\n",
  "files.insertFinalNewline": true,
  "files.trimTrailingWhitespace": true
}
```

This will check the formatting in VS Code, and also format on save.
npm package: @robinbobin/eslint-config
Description: My ESLint config
Author: Ruben Shalimov
Latest version: 1.0.2

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/eslint-config eslint@^9.39.1

# Config files

## <a name='config_eslint.config.js'></a>eslint.config.js

The script invoked during `postinstall` copies a sample ESLint config to your project root dir, naming the file `eslint.config.js_<number>`. Don't forget to delete the `_<number>` part from the file name. You can copy this sample config manually if you don't want to let `postinstall` execute:

    cp node_modules/@robinbobin/eslint-config/eslint.config.js_ ./eslint.config.js
npm package: @robinbobin/eslint-config-react
Description: My ESLint config for React (Native) projects
Author: Ruben Shalimov
Latest version: 1.0.3

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/eslint-config-react eslint@^9.39.1

The script invoked during `postinstall` copies a sample ESLint config to your project root dir, naming the file `eslint.config.js_<number>`. Don't forget to delete the `_<number>` part from the file name. You can copy this sample config manually if you don't want to let `postinstall` execute:

    cp node_modules/@robinbobin/eslint-config-react/eslint.config.js_ ./eslint.config.js
npm package: @robinbobin/eslint-config-react-native
Description: My ESLint config for React Native projects
Author: Ruben Shalimov
Latest version: 1.0.1

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/eslint-config-react-native eslint@^9.39.1

The script invoked during `postinstall` copies a sample ESLint config to your project root dir, naming the file `eslint.config.js_<number>`. Don't forget to delete the `_<number>` part from the file name. You can copy this sample config manually if you don't want to let `postinstall` execute:

    cp node_modules/@robinbobin/eslint-config-react/eslint.config.js_ ./eslint.config.js
npm package: @robinbobin/mimetype-constants
Description: Extensible MIME constants with typescript support
Author: Ruben Shalimov
Latest version: 2.0.3

Extensible MIME constants with typescript support.

    import { createTypeGroup, extend, mimeTypes } from '@robinbobin/mimetype-constants'

<!-- -->

    console.log(mimeTypes.application.ldJson) // 'application/ld+json'
    console.log(mimeTypes.application.aa) // undefined; TS will emit an error

<!-- -->

    const types = extend({
      ...createTypeGroup('aa', { aa: 'aa' }),
      ...createTypeGroup('application', { aa: 'aa' })
    })

    console.log(types.application.ldJson) // 'application/ld+json'
    console.log(types.application.aa) // 'application/aa'
    console.log(types.aa.aa) // 'aa/aa'

<!-- -->

    const types2 = extend({
      ...types,
      ...createTypeGroup('hooray', { aaa: 'aaa' })
    })

    console.log(types2.application.ldJson) // 'application/ld+json'
    console.log(types2.application.aa) // 'application/aa'
    console.log(types2.aa.aa) // 'aa/aa'
    console.log(types2.hooray.aaa) // 'hooray/aaa'
npm package: @robinbobin/prettier-config
Description: My Prettier config
Author: Ruben Shalimov
Latest version: 0.0.5

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/prettier-config prettier@^3.6.2

# Config files

## .prettierignore / .prettierrc.json

The script invoked during `postinstall` copies sample Prettier config files to your project root dir. You can copy them manually if you don't want to let `postinstall` execute:

    cp node_modules/@robinbobin/prettier-config/.prettierignore node_modules/@robinbobin/prettier-config/.prettierrc.json .
npm package: @robinbobin/ts-config
Description: My TS config
Author: Ruben Shalimov
Latest version: 1.0.0

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/ts-config typescript@^5.9.3

# Config files

## tsconfig.json

The script invoked during `postinstall` copies a sample TS config to your project root dir, naming the file `tsconfig.json_<number>`. Don't forget to delete the `_<number>` part from the file name. You can copy this sample config manually if you don't want to let `postinstall` execute:

    cp node_modules/@robinbobin/ts-config/tsconfig.json_ ./tsconfig.json
npm package: @robinbobin/ts-eslint-prettier
Description: My configs for TS, ESLint and Prettier
Author: Ruben Shalimov
Latest version: 3.1.1

# Deprecation notice

This package is deprecated in favor of [ts-config](https://www.npmjs.com/package/@robinbobin/ts-config), [eslint-config](https://www.npmjs.com/package/@robinbobin/eslint-config) / [eslint-config-react](https://www.npmjs.com/package/@robinbobin/eslint-config-react) and [prettier-config](https://www.npmjs.com/package/@robinbobin/prettier-config).

# Installation

Install the following packages:

    pnpm i --save-dev @robinbobin/ts-eslint-prettier eslint prettier typescript

For React (Native) projects:

    pnpm i --save-dev @types/react eslint-plugin-react-hooks react

# Config files

## tsconfig.json

Assuming you have the `src` folder at the top of your project:

    {
      "compilerOptions": {
        "declaration": true,
        "outDir": "js"
      },
      "extends": "@robinbobin/ts-eslint-prettier/tsconfig.base",
      "include": ["./*.mjs", "./src/**/*.ts"]
    }

For React (Native) projects:

    {
      "compilerOptions": {
        "declaration": true,
        "outDir": "js"
      },
      "extends": "@robinbobin/ts-eslint-prettier/tsconfig.base",
      "include": ["./*.mjs", "./src/**/*.ts", "./src/**/*.tsx"]
    }

## eslint.config.mjs

    import eslintConfig from '@robinbobin/ts-eslint-prettier/eslint.config.mjs'

    export default [
      ...eslintConfig,
    ]

If you're getting

    The inferred type of 'array' cannot be named without a reference to '.pnpm/@typescript-eslint+utils...'

:

    import eslintConfig from '@robinbobin/ts-eslint-prettier/eslint.config.mjs'

    /** @type unknown[] */
    const array = [...eslintConfig]

    export default array

For React (Native) projects:

    import config from '@robinbobin/ts-eslint-prettier/eslint.config.mjs'
    import configPluginReactHooks from '@robinbobin/ts-eslint-prettier/eslint.config.plugin.react.hooks.mjs'

    export default [
      ...config,
      ...configPluginReactHooks,
      {
        rules: {
          'react-hooks/exhaustive-deps': 'error'
        }
      }
    ]

## prettier.config.mjs

    export { default } from '@robinbobin/ts-eslint-prettier/prettier.config.mjs'

## .prettierignore

    /js
    /pnpm-lock.yaml

## .gitignore

    /js
    node_modules

# package.json

Add the the following to `package.json`:

    "files": [
      "/js",
      "/src"
    ]

# Scripts

## prepack.sh

    #!/bin/bash
    rm -rf js &&
    pnpm tsc &&
    pnpm eslint &&
    pnpm prettier . --check

<!-- -->

    chmod u+x prepack.sh

`package.json`:

    "scripts": {
      "prepack": "./prepack.sh"
    }