open-index/open-npm huggingface dataset:
npm package: @shelf/aws-ddb-with-xray
Description: AWS DynamoDB Document Client initialized with X-Ray
Author: Vlad Holubiev
Latest version: 2.4.1

# aws-ddb-with-xray [![CircleCI](https://circleci.com/gh/shelfio/aws-ddb-with-xray/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-ddb-with-xray/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/aws-ddb-with-xray.svg)](https://www.npmjs.com/package/@shelf/aws-ddb-with-xray)

> Adding X-Ray to DynamoDB Document Client requires a hack (see https://git.io/JeaSG). This package encapsulates that logic. Also, it imports only the DynamoDB client not the full aws-sdk [for better performance](https://theburningmonk.com/2019/03/just-how-expensive-is-the-full-aws-sdk/)

## Install

```
$ yarn add @shelf/aws-ddb-with-xray
```

## Usage

```js
const {getDocumentClient} = require('@shelf/aws-ddb-with-xray');

const ddb = getDocumentClient({
  ddbParams: {region: 'us-east-1', convertEmptyValues: true},
  ddbClientParams: {region: 'us-east-1'},
});

await ddb
  .get({
    TableName: 'foo',
    Key: {hash_key: 'bar'},
  })
  .promise();
```

## Result

![](./xray.png)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/aws-lambda-brotli-unpacker
Description: Unpacks large Lambda binaries to /tmp
Author: Vlad Holubiev
Latest version: 2.1.0

# aws-lambda-brotli-unpacker [![CircleCI](https://circleci.com/gh/shelfio/aws-lambda-brotli-unpacker/tree/master.svg?style=svg&circle-token=a31c3d7699a00ad54a4a8c3fce9e8636973c81f3)](https://circleci.com/gh/shelfio/aws-lambda-brotli-unpacker/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Unpacks large Lambda binaries to /tmp, such as Tesseract, LibreOffice, Google Chrome, etc

Inspired by [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda)

Used in projects: [aws-lambda-tesseract](https://github.com/shelfio/aws-lambda-tesseract)

## Install

```
$ yarn add @shelf/aws-lambda-brotli-unpacker
```

Version 1.x works with Node 10.x & 12.x only. For Node 8.10 use v0.0.2

## Test

Needs Docker installed.

```
$ npm test
```

## Usage

> Q: Why do I need this package?

A: It helps if you want to deploy pre-compiled software to use in Lambda. See list of projects where it is used above.

> Q: Why bother?

A: Lambda environment has limited software installed. This package helps ship large binaries compiled for Lambda
which unpack to `/tmp` folder when Lambda starts.

> Q: Why `/tmp`?

A: Lambda has [500 MB of storage](https://docs.aws.amazon.com/lambda/latest/dg/running-lambda-code.html) in `/tmp`

> Q: Why brotli?

A: This compression algorithm is known for great speed/size ration. Perfect for scarce Lambda resources.

## Example

```js
const {unpack} = require('@shelf/aws-lambda-brotli-unpacker');
const {execSync} = require('child_process');

const inputPath = path.join(__dirname, '..', 'bin', 'tt.tar.br'); // for example, tesseract
const outputPath = '/tmp/tesseract/tesseract';

module.exports.handler = async event => {
  await unpack({inputPath, outputPath});

  execSync(`${outputPath} -l eng image.png`);
};
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/aws-lambda-tesseract
Description: 6 MB Tesseract 4.1 (with English training data) to fit inside AWS Lambda
Author: Vlad Holubiev
Latest version: 5.2.0

# aws-lambda-tesseract [![CircleCI](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![Tesseract](https://img.shields.io/badge/tesserract-6_MB-brightgreen.svg)](bin/)

> 6 MB Tesseract 5.3.3 (with English training data) to fit inside AWS Lambda

Inspired by [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda) & [lambda-scanner-ocr](https://github.com/philippkeller/lambda-scanner-ocr)

## Install

```
$ yarn add @shelf/aws-lambda-tesseract
```

`1.x` versions of this library were compiled for Node 8.10.

`2.x` was compiled for Node 10.x runtime.

`3.x` works for Node 12.x runtime.

`4.x` works for Node 16.x runtime and compiled with **Tesseract 5.1.0**. It works with x86_64 CPUs for now only.

`5.x` works for Node 18.x runtime and compiled with **Tesseract 5.3.3**. It works with arm64 CPUs.

## How does it work?

This package contains an archive with [Tesseract 5.3.3](https://github.com/tesseract-ocr/tesseract) compiled for usage in AWS Lambda environment.

When a Lambda starts, it unpacks an archive with a binary to the `/tmp` folder and makes sure it's done only once per Lambda cold start.

## Usage

```js
const {getTextFromImage, isSupportedFile} = require('@shelf/aws-lambda-tesseract');

module.exports.handler = async event => {
  // assuming there is a photo.jpg inside /tmp dir
  // original file will be deleted afterwards

  if (!isSupportedFile('/tmp/photo.jpg')) {
    return false;
  }

  return getTextFromImage('/tmp/photo.jpg');
};
```

`isSupportedFile` checks that file has image-like file extension and it's not in the list of
unsupported by Tesseract file extensions.

## Compile It Yourself

See [compile-tesseract.sh](compile-tesseract.sh)

Smoke test that it works by running `test.sh` script

## See Also

- [aws-lambda-libreoffice](https://github.com/shelfio/aws-lambda-libreoffice)
- [chrome-aws-lambda-layer](https://github.com/shelfio/chrome-aws-lambda-layer)
- [ghostscript-lambda-layer](https://github.com/shelfio/ghostscript-lambda-layer)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/aws-sns-message-attributes
Description: Transform JSON into AWS SNS message attributes format
Author: Vlad Holubiev
Latest version: 2.0.0

# aws-sns-message-attributes [![CircleCI](https://circleci.com/gh/shelfio/aws-sns-message-attributes/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-sns-message-attributes/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/aws-sns-message-attributes.svg)](https://www.npmjs.com/package/@shelf/aws-sns-message-attributes)

> Transform JSON into AWS SNS message attributes format. See [1](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html), [2](https://docs.aws.amazon.com/sns/latest/dg/sns-subscription-filter-policies.html)

## Install

```
$ yarn add @shelf/aws-sns-message-attributes
```

## Usage

```js
const {transformMessageAttributes} = require('@shelf/aws-sns-message-attributes');

transformMessageAttributes({
  string: 'hello',
  array: ['hello', 'world'],
  number: 1,
  bool: true,
});

/*
{
  string: {DataType: 'String', StringValue: 'hello'},
  array: {DataType: 'String.Array', StringValue: '["hello","world"]'},
  number: {DataType: 'Number', StringValue: 1},
  bool: {DataType: 'String', StringValue: 'true'},
}
 */
```

_Note:_ This library does not support binary values

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/aws-ssm-get-param-cli
Description: aws-ssm-get-param-cli
Author: Vlad Holubiev
Latest version: 0.0.5

# aws-ssm-get-param-cli [![CircleCI](https://circleci.com/gh/shelfio/aws-ssm-get-param-cli/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-ssm-get-param-cli/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Fetch SSM parameter

## Usage

```
$ export DOMAIN=$(npx @shelf/aws-ssm-get-param-cli "/prod/domain")
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/babel-config
Description: babel-config
Author: Vlad Holubiev
Latest version: 3.0.0

# @shelf/babel-config

## Install

```
$ yarn add --dev @shelf/babel-config
```

## Usage

In your `package.json`:

### Backend

```json
{
  "babel": {
    "extends": "@shelf/babel-config/backend"
  }
}
```

### Frontend

React components without browser boilerplate (jsx,tsx) + testing (ts/tsx)

```json
{
  "babel": {
    "extends": "@shelf/babel-config/frontend"
  }
}
```

React components(jsx,tsx) + testing (ts/tsx)

```json
{
  "babel": {
    "extends": "@shelf/babel-config/frontend-component"
  }
}
```

Frontend library (lodash, ts)

```json
{
  "babel": {
    "extends": "@shelf/babel-config/frontend-library"
  }
}
```

Vue.js  configuration

```json
{
  "babel": {
    "extends": "@shelf/babel-config/frontend-vue"
  }
}
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/bem
Description: Wrapper around BEM for CSS
Author: Vlad Holubiev
Latest version: 5.0.0

# Shelf/bem [![CircleCI](https://app.circleci.com/pipelines/github/shelfio/bem)](https://circleci.com/gh/shelfio/xxxxxx/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

Slim version of [bem-cn](https://github.com/albburtsev/bem-cn) without mixins, state and other stuff.

## Install

```
$ yarn add @shelf/bem
```

## Usage

```js
import {block} from '@shelf/bem';

const b = block('nav-item');

function NavLink({isActive, href, icon, name}) {
  return (
    <li className={b({active: isActive})}> // .nav-item .nav-item--active
      <Icon icon={icon} className={b('icon')} /> // .nav-item__icon
      <a href={href} className={b('link')}>  // .nav-item__link
        {name}
      </a>
    </li>
  );
}
```

## API

### block

You can pass either element or modifiers as a first argument. Modifies can be passed as an array or object.

```js
import {block} from '@shelf/bem';

const b = block('nav-item');

b(); // nav-item
b('link'); // nav-item__link
b(['active']); // nav-item nav-item--active
b({active: true}); // nav-item nav-item--active
```

Second argument is modifiers & could be combined with element. You can pass them as an array or object.

```js
const isActive = true;
b('link', [isActive && 'active']); // nav-item__link nav-item__link--active

const isSelected = true;
b('link', {selecter: isSelected}); // nav-item__link nav-item__link--selected
```

### setup

You can setup your own delimiters for element and modifier

```js
import {setup} from '@shelf/bem';

const block = setup({el: '_', mod: '-'});
const b = block('nav-item');

b('link'); // nav-item_link
b('link', ['active']); // nav-item_link nav-item_link-active
```

Additionally you can pass `ns` to customize namespace

```
const block = setup({ns: 'my-app-'});
const b = block('nav-item');

b(); // my-app-nav-item
```

You can also provide custom classMap to map your class names to bem class names. Helpful when you want to use bem with
css modules.

```js
import {setup} from '@shelf/bem';

const block = setup({classMap: {'nav-item__link': 'nav-item__link-13'}});
const b = block('nav-item');

b('link'); // nav-item__link-13
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/betterer-config
Description: betterer-config
Author: Mykyta Khmel
Latest version: 0.1.0

# betterer-config [![CircleCI](https://circleci.com/gh/shelfio/betterer-config/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/betterer-config/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> betterer-config description

## Install

```
$ yarn add @shelf/betterer-config
```

## Usage
Inside `.betterer.ts`:

```ts
import frontendConfig  from '@shelf/betterer-config/frontend.js';

const sourceCodePatters = [
  'imports/**/*.{js,jsx,ts,tsx}',
  'client/**/*.{js,jsx,ts,tsx}',
  'server/**/*.{js,jsx,ts,tsx}',
  'packages/**/*.{js,jsx,ts,tsx}',
];

const tsFilesPattern = [
  'imports/**/*.{ts,tsx}',
  'client/**/*.{ts,tsx}',
  'server/**/*.{ts,tsx}',
  'packages/**/*.{ts,tsx}',
];

const config = frontendConfig({
  jsFilesPattern: sourceCodePatters,
  todoFilesPattern: sourceCodePatters,
  tsFilesPattern,
  tsConfigPath: 'tsconfig.json',
  eslintRules: {'no-debugger': 'error'},
  eslintFilesPatterns: sourceCodePatters,
});

export default config;
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/datetime
Description: Shelf dates library
Author: Shelf
Latest version: 2.7.1

# Shelf/datetime [![CircleCI](https://app.circleci.com/pipelines/github/shelfio/datetime.svg?style=svg)](https://app.circleci.com/pipelines/github/shelfio/datetime)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Shelf dates library. Wrapper on [dayjs](https://day.js.org/) with more of date-fns API

## Install

```
$ yarn add @shelf/datetime
```

## Usage

```js
import {setGlobalLocale, formatDistance} from '@shelf/datetime';
// OR
import setGlobalLocale from '@shelf/datetime/lib/setGlobaleLocale';
import formatDistance from '@shelf/datetime/lib/formatDistance';

setGlobalLocale('uk'); // set non-default locale (default 'en')

formatDistance(new Date(1986, 3, 4, 10, 32, 0), new Date(1986, 3, 4, 10, 32, 20));

setGlobalLocale('en');

formatDistance(new Date(1986, 3, 4, 10, 32, 0), new Date(1986, 3, 4, 10, 32, 20)); // a few seconds ago
```

## React components

Usage:

```jsx
import {FormatTime, RelatimeTime} from '@shelf/datetime/react';

<FormatTime date={new Date()} />;
<FormatTime date="2025-01-02T03:04:05Z" />;
<FormatTime date={new Date()} format="YYYY-MM-DD HH:mm" className="text-xs" />;

<RelatimeTime date={new Date(Date.now() - 60_000)} />;
<RelatimeTime date="2025-01-02T03:03:05Z" addSuffix />;

<FormatTime date={new Date()} asChild className="text-sm">
  <time data-testid="time" />
</FormatTime>;
```

## Publish

```sh
$ git checkout master
$ pnpm version
$ pnpm publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/deprecated-browser-shim
Description: Functions to detect deprecated browsers and render screen with warning in them
Author: Mykyta Khmel
Latest version: 2.1.1

# deprecated-browser-shim ![prettier badge](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> deprecated-browser-shim description

## Install

```
$ yarn add @shelf/deprecated-browser-shim
```

## Usage

In node project:
```js
import {isDeprecatedBrowser, renderSplashScreen} from '@shelf/deprecated-browser-shim';

if(isDeprecatedBrowser()){
  const appName = 'App'; // provide app name
  renderSplashScreen(appName);
}
```
in browser as UMD
```html
 <script src="/lib/index.js"></script>

    <script>
      if(DeprecatedBrowserShim.isDeprecatedBrowser()){
        const appName = 'App'; // provide app name
        DeprecatedBrowserShim.renderSplashScreen(appName);
      }
    </script>
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/elasticsearch-local
Description: Run 6+ version of ElasticSearch locally
Author: Vitalii Sikora
Latest version: 3.2.0

# elasticsearch-local [![CircleCI](https://circleci.com/gh/shelfio/elasticsearch-local/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/elasticsearch-local/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/elasticsearch-local.svg)](https://www.npmjs.com/package/@shelf/elasticsearch-local)

> Run any version of ElasticSearch locally

## Usage

### 0. Install

```
$ yarn add @shelf/elasticsearch-local --dev
```

### 1. Start Elasticsearch

```js
import {start} from '@shelf/elasticsearch-local';

await start({
  esVersion: '8.2.2',
  port: 9000, // optional
  clusterName: 'test', // optional
  nodeName: 'test', // optional
  indexes: [
    {
      name: 'your-index',
      // create index with options - https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-api-request-body
      body: {
        settings: {
          number_of_shards: '1',
          number_of_replicas: '1'
        },
        aliases: {
          'some-acc-id': {}
        },
        mappings: {
          "properties": {
            "field1" : {"type" : "text"}
        }
      }
    }
  ] // optional
});
```

### 2. Stop Elasticsearch

```js
import {stop} from '@shelf/elasticsearch-local';

stop();
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/esbuild-config
Description: A collection of configurations and utilities to help you build projects or libraries using esbuild. Includes plugins for common tasks like transpiling TypeScript and compiling SASS and styled-components, as well as presets for React.
Author: Andrii Myroniuk
Latest version: 0.3.0

# @shelf/esbuild-config ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> A collection of configurations and utilities to help you build projects or libraries using esbuild. This package includes plugins for common tasks like transpiling TypeScript and compiling SASS and styled-components, as well as presets for React.

## Install

```
$ yarn add -D @shelf/esbuild-config
```

## Usage
Once installed, you can use esbuild-config to configure and run your esbuild builds. The package provides two utility functions, common() and frontend(), that you can import and call from your build scripts:

```js
// Import the function you need
import {common, frontend} from '@shelf/esbuild-config';

// Call the functions with your options
await common({
  entryPoints: ['src/index.ts'],
  target: ['esnext', 'node16'],
  // ...
});

await frontend({
  entryPoints: ['src/index.ts'],
  target: ['esnext', 'node16'],
  sassConfig: {
    // ...
  },
  // ...
});
```
Both functions accept a similar set of options that you can use to customize the build process according to your needs. Check the JSDoc comments in the code for more information on the available options.

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/eslint-config
Description: ESLint Config for Shelf Projects
Author: Vlad Holubiev
Latest version: 6.3.0

# @shelf/eslint-config

## Style Guide

Read our [style guide](./docs/style-guide.md)

## Install

```bash
$ pnpm add --save-dev --save-exact @shelf/eslint-config
```

## Usage

### Backend

```js
import tsConfig from '@shelf/eslint-config/typescript.js';

export default [...tsConfig];
```

### Frontend

```js
import feTsConfig from '@shelf/eslint-config/frontend-typescript.js';

export default [
  ...feTsConfig,
  {
    settings: {
      react: {
        version: 'detect',
      },
    },
  },
];
```

## Oxfmt Migrations

Repos that move formatting out of ESLint and into Oxfmt should use the additive no-Prettier entrypoints:

### Backend, no Prettier plugin

```js
import tsConfig from '@shelf/eslint-config/typescript-no-prettier.js';

export default [...tsConfig];
```

### Frontend, no Prettier plugin

```js
import feTsConfig from '@shelf/eslint-config/frontend-typescript-no-prettier.js';

export default [
  ...feTsConfig,
  {
    settings: {
      react: {
        version: 'detect',
      },
    },
  },
];
```

The legacy `typescript.js` and `frontend-typescript.js` entrypoints stay supported for repos that still format through Prettier.

## Publish

```sh
$ pnpx np
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/fast-uslug
Description: A 30x faster version of the "uslug" package
Author: Vlad Holubiev
Latest version: 1.2.0

# fast-uslug [![CircleCI](https://circleci.com/gh/shelfio/fast-uslug/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/fast-uslug/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> It was forked from [uslug](https://github.com/jeremys/uslug).

> **30x** faster than [uslug](https://github.com/jeremys/uslug).

Permissive slug generator that works with unicode.
We keep only characters from the categories Letter, Number and Separator (see [Unicode Categories](http://www.unicode.org/versions/Unicode6.0.0/ch04.pdf))
and the common [CJK Unified Ideographs](http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf) as defined in the version 6.0.0 of the Unicode specification.

Inspired by [unicode-slugify](https://github.com/mozilla/unicode-slugify).
Note that this slug generator is different from [node-slug](https://github.com/dodo/node-slug) which focus on translating unicode characters to english or latin equivalent.

## Install

```
$ yarn add @shelf/fast-uslug
```

## Usage

```js
import {fastUslug} from '@shelf/fast-uslug';

fastUslug('some string'); // some-string
```

### Quick Examples

```typescript
import {fastUslug} from '@shelf/fast-uslug';

fastUslug('Ґатунок Їхніх обценьок неперевершений!'); // 'ґатунок-їхніх-обценьок-неперевершений'
fastUslug('汉语/漢語'); // '汉语漢語'

fastUslug('Y U NO', {lower: false}); // 'Y-U-NO'
fastUslug('Y U NO', {spaces: true}); // 'y u no'
fastUslug('Y-U|NO', {allowedChars: '|'}); // 'yu|no'
```

## Benchmark

| [uslug](https://github.com/jeremys/uslug) | [@shelf/fast-uslug](https://github.com/shelfio/fast-uslug) | Improvement |
| ----------------------------------------- | ---------------------------------------------------------- | ----------- |
| 10 words: 7 375 ops/s, ±0.19%             | 10 words: 243 646 ops/s, ±0.19%                            | 33x         |
| 100 words: 702 ops/s, ±0.10%              | 100 words: 22 683 ops/s, ±0.17%                            | 32x         |
| 1000 words: 69 ops/s, ±0.17%              | 1000 words: 2 241 ops/s, ±0.17%                            | 34x         |

You can run `yarn benhmark` to test on your own.

## Options

### fastUslug(string, options)

Generate a slug for the string passed.

**Arguments**

- string - The string you want to slugify.
- options - An optional object that can contain:
  - allowedChars: a Set of chars that you want to be whitelisted. Default: '-\_~'.
  - lower: a Boolean to force to lower case the slug. Default: true.
  - spaces: a Boolean to allow spaces. Default: false.

## See Also

- [fast-normalize-spaces](https://github.com/shelfio/fast-normalize-spaces)
- [fast-natural-order-by](https://github.com/shelfio/fast-natural-order-by)
- [fast-chunk-string](https://github.com/shelfio/fast-chunk-string)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/froala-image-upload-s3-signature
Description: Get S3 signature for Froala editor with configurable expiration time
Author: Vitalii Sikora
Latest version: 1.0.1

# froala-image-upload-s3-signature

Originally copied source code from https://github.com/froala/wysiwyg-editor-node-sdk and added ability to set custom expiration time for the signature.

## Install

```
$ yarn add @shelf/froala-image-upload-s3-signature
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/get-video-id
Description: Wrapper around https://github.com/radiovisual/get-video-id to return youtube start from query params
Author: Yaroslav Chapelskyi
Latest version: 1.0.1

# @shelf/get-video-id [![CircleCI](https://app.circleci.com/pipelines/github/shelfio/get-video-id)](https://app.circleci.com/pipelines/github/shelfio/get-video-id)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

Wrapper around https://github.com/radiovisual/get-video-id to return video service query params (youtube `starts from` as an example )

## Install

```shell script
yarn add @shelf/get-video-id
```

## Usage

```js
import getVideoId from '@shelf/get-video-id';

getVideoId('https://youtu.be/LqTuxFElqag');
/** => {
  id: 'LqTuxFElqag',
  service: 'youtube',
  embedURL: 'https://www.youtube.com/embed/LqTuxFElqag'
} **/

getVideoId('https://youtu.be/LqTuxFElqag?t=7939'); // With time param
/** => {
  id: 'LqTuxFElqag',
  service: 'youtube',
  embedURL: 'https://www.youtube.com/embed/LqTuxFElqag?start=7939'
} **/

getVideoId('https://vimeo.com/259411563#t=50s');
/** => {
  id: '259411563',
  service: 'vimeo',
  embedURL: 'https://player.vimeo.com/video/259411563'
} **/
```

## API

Documentation is available [here](https://github.com/radiovisual/get-video-id)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/gh-sdk
Description: Convenient wrapper for GitHub API for automation tasks
Author: Vlad Holubiev
Latest version: 2.0.0

# gh-sdk [![CircleCI](https://circleci.com/gh/shelfio/gh-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/gh-sdk/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Convenient wrapper for GitHub API for automation tasks

## Install

```
$ yarn add @shelf/gh-sdk
```

## Usage

```js
import { approvePR, mergePR, listPrs, getUserOrgs } from "@shelf/gh-sdk";

approvePR({ owner: "shelf", repo: "api", pr: 3 });
assignReleaseLabelToPR("shelf", "api", 134);
getRepoMergeStrategies("shelf", "api");
createReleaseBranch({ owner: "shelf", repo: "api", version: "1.2.3", sha: "dev" }); // => ref 'refs/heads/release/v1.2.3` (refs/heads - for git link)
createReleaseLabel("shelf", "api");
createReleasePR({ owner: "shelf", repo: "api", version: "1.2.3", releaseTitle: "Good stuff" }); // => ref: 'release/v1.2.3`, title: Release v1.2.3: Good stuff
deleteBranch({ owner: "shelf", repo: "api", ref: "dev" });
extractRepoNameFromURL("https://github.com/shelfio/gh-sdk/pulls/5"); // => gh-sdk
getLatestBranchCommit({ owner: "shelf", repo: "api", branch: "dev" });
getLatestDevelopCommit({ owner: "shelf", repo: "api" }); // {branch: 'develop} as default
getLatestDevelopCommitSHA({ owner: "shelf", repo: "api" }); // => 'develop-branch-hash-string'
getPR({ owner: "shelf", repo: "api", pr: 3 });
getRepoBranch({ owner: "shelf", repo: "api", branch: "dev" });
getRepoBranches({ owner: "shelf", repo: "api" }); // => [, {branch}]
getRepoBranchesNames({ owner: "shelf", repo: "api" }); // => [, 'branch-ref']
getRepoLabels("shelf", "api");
getUserOrgs();
listClosedPRs({ owner: "shelf", searchText: "renovate" });
listOrgRepos({ org: "shelfio", type: "sources", skipArchived: true }); // => [, {repo}]
listPrs({ owner: "shelf", searchText: "renovate" });
mergePR({ owner: "shelf", repo: "api", pr: 3 });
updateRepoMergeStrategies({
  owner: 'shelfio',
  repo: 'api',
  allowMergeCommits: false,
  allowSquash: false,
  allowRebase: true,
});
getOpenRepoPRsFromHuman('shelf', 'repo');
getCommitChecks('shelf', 'repo', 'sha');
getPRCommitRefsWithMessages('shelf', 'repo', 3);
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/hotkeys
Description: Hotkeys react bindings to make best user experience
Author: Yaroslav Chapelskyi
Latest version: 1.1.1

# @shelf/hotkeys

> A tiny (1Kb) set of React hotkeys utilities to make great user experience 🚀.
> Build on top of [tinykeys](https://github.com/jamiebuilds/tinykeys)

Features:

- [x] Global hotkeys
- [x] Element specific hotkeys
- [x] Modifiers support
- [x] Sequence hotkeys
- [x] Disabled on input elements by default
- [x] TypeScript support
- [x] 100% test coverage
- [x] Pure ESM build. [See](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)

## Installation

```sh
yarn add @shelf/hotkeys react
```

## Usage

```tsx
import {Hotkey} from '@shelf/hotkeys';

function Demo() {
  return (
    <Hotkey
      binding={'$mod+a'}
      onAction={() => {
        // Do some amazing stuff 🚀
      }}
    />
  );
}
```

### Hotkey

`binding`
See [tinykeys](https://github.com/jamiebuilds/tinykeys/blob/main/README.md#commonly-used-keys-and-codes) for more info

`onAction`
Function to be called when hotkey is pressed. Accept Keyboard event as first argument.

`options.disableOnInputs`
Disable hotkey when input/textarea element is focused. Default: `true`

Examples:

```tsx
<Hotkey binding={'a'} onAction={}/> // single key case insensitive
<Hotkey binding={'1'} onAction={}/> // number keys
<Hotkey binding={'Escape'} onAction={}/>
<Hotkey binding={'Enter'} onAction={}/>

// ⌘ + a on macOS, Ctrl + a on Windows and Linux
<Hotkey binding={'$mod+a'} onAction={}/>

// sequence hotkey support by empty space
<Hotkey binding={'g i'} onAction={}/>

// combination of keys, make sure no spaces between keys
<Hotkey binding={'Control+a'} onAction={}/>

// $mod is a special key for ⌘ on macOS and Ctrl on Windows and Linux
<Hotkey binding={'$mod+a'} onAction={}/>


// Prevent default browser action opening new tab
<Hotkey binding={'$mod+T'} onAction={event => {
  event.preventDefault();
}}/>


// Enable hotkey when input/textarea element is focused
<Hotkey
  binding={'a'}
  onAction={}
  options={{
    disableOnInputs: false,
    event: 'keyup' // default is keydown
  }}
/>
```

### useHotkeys

`useHotkeys(keymap, [options], [element])` is a hook that allows you to register multiple hotkeys at once.

```tsx
import {useHotkeys} from '@shelf/hotkeys';

function Demo() {
  useHotkeys(
    {
      '$mod+a': () => {},
      'g i': () => {},
      // Do some amazing stuff 🚀
    },
    {
      disableOnInputs: false,
    }
  );

  return <div>...</div>;
}
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/image-preview-overlay
Description: Plain wrapper that renders full image preview on child image tag click
Author: Dmytro Bondarenko
Latest version: 1.3.0

## Installation
Note: uses styled-components

Install the library using npm:

```shell
$ npm install styled-components
```
```shell
$ npm install @shelf/image-preview-overlay
```

Install the library using yarn:

```shell
$ yarn add styled-components
```
```shell
$ yarn add @shelf/image-preview-overlay
```

## Props

| Prop Name | Type | Description|
|-----------|------|------------|
| getImages | `function (optional)`| A function that can be used to modify preview images list. Signature: `(event: ElementMouseEvent) => {src: string; alt?: string}[] \| undefined`|
| getInitialPreviewImageIndex | `function (optional)` | A function to customly choose the initial image from the list to be shown when fullview is opened |
| startPreviewFromTargetImage | `boolean (optional)`| Default false (always opens first image from the list). If set to true - will try to open the target image (if it is present in the list returned by getImages) |
| triggerProps, portalWrapperProps, imageOverlayProps | `HTMLAttributes<HTMLDivElement> (optional)` | HTML attributes passed to the corresponding elements |  
| imageProps | `HTMLAttributes<HTMLImageElement> (optional)` | HTML attributes passed to the fullview image element |

## Usage

### ImagePreviewOverlay

`ImagePreviewOverlay` is a wrapper that renders full image preview on child image tag click

```js
import {ImagePreviewOverlay} from '@shelf/image-preview-overlay';

// Simple usage
const Component = () => (
  <ImagePreviewOverlay>
    <span>
      Shelf.io
      <p>
        <img src={'shelf.io'} />
      </p>
    </span>
  </ImagePreviewOverlay>
);

// Custom getImages prop and multiple images
const Component = () => {
  const getImages = _event => [
    {
      src: 'source-1',
      alt: 'source 1 alt',
    },
    {
      src: 'source-2',
    },
  ];

  return (
    <ImagePreviewOverlay getImages={getImages}>
      <img src={'image-snippet-src'} />
    </ImagePreviewOverlay>
  );
};
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/is-audio-filepath
Description: Determine whether filepath is for audio file
Author: Vitalii Sikora
Latest version: 3.0.1

# is-audio-filepath [![CircleCI](https://circleci.com/gh/shelfio/is-audio-filepath/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/is-audio-filepath/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> is-audio-filepath

## Install

```
$ yarn add @shelf/is-audio-filepath
```

## Usage

```js
const isAudioFilepath = require('@shelf/is-audio-filepath');

isAudioFilepath('folder/file.mp3');
// => true
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/is-string-in-quotes
Description: Check if string is inside quotation marks (22 styles)
Author: Vlad Holubiev
Latest version: 1.0.0

# is-string-in-quotes [![CircleCI](https://circleci.com/gh/shelfio/is-string-in-quotes/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/is-string-in-quotes/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/is-string-in-quotes.svg)](https://www.npmjs.com/package/@shelf/is-string-in-quotes)

> Check if string is inside quotation marks. Supports 22 quotation styles ([source](https://en.wikipedia.org/wiki/Quotation_mark#Summary_table))

## Install

```
$ yarn add @shelf/is-string-in-quotes
```

## Usage

```js
const {isStringInQuotes} = require('@shelf/is-string-in-quotes');

isStringInQuotes('«hello»');
isStringInQuotes('„hello”');
isStringInQuotes('"hello"');
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/is-valid-email-address
Description: Email validator
Author: Iryna Holovko
Latest version: 1.0.0

# @shelf/is-valid-email-address

Compliant with [RFC 3696](https://www.rfc-editor.org/rfc/rfc3696#section-3)

## Install

```
$ yarn add @shelf/is-valid-email-address
```

## Usage

```js
const {isValidEmail} = import('@shelf/is-valid-email-address');

isValidEmail('email@example.com'); // true
isValidEmail('invalid"email@example.com'); // false
```

<details>
<summary>Benchmark</summary>

```
test@somemail.com:
2 157 335 ops/s, ±3.85%    | 86.93% slower

Abc\@def@example.com:
1 555 215 ops/s, ±0.71%    | 90.57% slower

very."(),:;<>[]".VERY."very@\\ very".unusual@strange.example.com:
917 709 ops/s, ±0.20%      | slowest, 94.44% slower

much."more\ unusual"@example.com:
1 505 956 ops/s, ±0.20%    | 90.87% slower

@test.com:
1 762 869 ops/s, ±0.21%    | 89.32% slower

@@mail.com:
3 410 584 ops/s, ±0.18%    | 79.33% slower

test..test@sdf.com:
16 500 605 ops/s, ±0.21%   | fastest

mlewan.@att.net:
3 327 090 ops/s, ±0.20%    | 79.84% slower
```

</details>

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/jest-gremlin
Description: Run your tests using Jest & Apache Tinkerpop Docker container
Author: Dmytro Harazdovskyi
Latest version: 2.0.0

# jest-gremlin [![CircleCI](https://circleci.com/gh/shelfio/jest-gremlin/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/jest-gremlin/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/jest-gremlin.svg)](https://www.npmjs.com/package/@shelf/jest-gremlin)

> Jest preset to run Gremlin server before tests

## Usage

### 1. Have installed docker-compatible container engine!
This plugin tested with [Docker](https://docs.docker.com/get-docker/) and [Podman](https://podman.io/), but it can work with any container engine that supports Docker CLI commands.

### 2. Install

```
$ yarn add @shelf/jest-gremlin --dev
```

### 3. Create `jest.config.js`

```js
module.exports = {
  preset: '@shelf/jest-gremlin',
};
```

If you have a custom `jest.config.js` make sure you remove `testEnvironment` property, otherwise it will conflict with the preset.

### 4. Create `jest-gremlin-config.js`

```js
import cwd from 'cwd';

module.exports = {
  port: 8182,
  protocol: 'ws',
  imageName: 'tinkerpop/gremlin-server', // or your custom prebuilt image
  imagePort: 8182, // port on which gremlin server is running inside the container
  containerName: 'gremlin-server', // or your custom container name that would be spin up
  maxTries: 10, // how many times to try to connect to gremlin server ()
  triesInterval: 1000, // interval between tries
  containerEngine: 'docker', // or 'podman' if you use podman - used in cli commands to start/stop container
};
```

### 5. PROFIT! Write tests

```js
it();
```

## Monorepo Support

By default the `jest-gremlin-config.js` is read from `cwd` directory, but this might not be
suitable for monorepos with nested [jest projects](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig)
with nested `jest.config.*` files nested in subdirectories.

If your `jest-gremlin-config.js` file is not located at `{cwd}/jest-gremlin-config.js` or you
are using nested `jest projects`, you can define the environment variable `JEST_GREMLIN_CONFIG`
with the absolute path of the respective `jest-gremlin-config.js` file.

### Example Using `JEST_GREMLIN_CONFIG` in nested project

```js
// src/nested/project/jest.config.js
const path = require('path');

// Define path of project level config - extension not required as file will be imported
// via `require(process.env.JEST_GREMLIN_CONFIG)`
process.env.JEST_GREMLIN_CONFIG = path.resolve(__dirname, './jest-gremlin-config');

module.exports = {
  preset: '@shelf/jest-gremlin',
  displayName: 'nested-project',
};
```

## See Also

- [postgres-local](https://github.com/shelfio/postgres-local)
- [jest-elasticsearch](https://github.com/shelfio/jest-elasticsearch)
- [jest-dynamodb](https://github.com/shelfio/jest-dynamodb)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/jest-redis
Description: Run your tests using Jest & Redis local
Author: Shelf Backend
Latest version: 0.0.1

# Jest-redis (https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Jest preset to run Redis Local

## Install

```
$ yarn add @shelf/jest-redis --dev
```

## Usage

1. Create jest config

```js
module.exports = {
  preset: '@shelf/jest-redis',
};
```

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/jest-testrail-reporter
Description: jest-testrail-reporter
Author: Vlad Holubiev
Latest version: 1.1.2

# jest-testrail-reporter [![CircleCI](https://circleci.com/gh/shelfio/jest-testrail-reporter/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/jest-testrail-reporter/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

> Simple package to submit jest test results to TestRail

## Install

```
$ yarn add --dev @shelf/jest-testrail-reporter
```

## Usage

Step 1. In your `package.json`

```json
{
  "jest": {
    "reporters": ["default", "@shelf/jest-testrail-reporter"]
  }
}
```

Step 2. Add Test Case IDs to your tests in the following format: `#C123`

```ts
it('#C123 should do smth', () => {
  expect(true).toBe(true);
});
```

Step 3. Ensure you have environment variables with credentials setup:

- `process.env.TESTRAIL_HOST`
- `process.env.TESTRAIL_EMAIL`
- `process.env.TESTRAIL_PASSWORD`
- `process.env.TESTRAIL_PROJECT_ID`

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/postgres-local
Description: Run Postgres locally
Author: Dmytro Harazdovskyi
Latest version: 1.1.2

# postgres-local [![CircleCI](https://dl.circleci.com/status-badge/img/gh/shelfio/postgres-local/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/shelfio/postgres-local/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/postgres-local.svg)](https://www.npmjs.com/package/@shelf/postgres-local)

> Run any version of Postgres locally

## Usage

### 0. Install

```
$ yarn add @shelf/postgres-local --dev
```

### 1. Start Postgres

#### ES Modules

```js
import {start} from '@shelf/postgres-local';

await start({
  seedPath: "schema.sql",
  version: 17,
  port: 5555,
  includeInstallation: true,
  debugMode: false
});
```

#### CommonJS

```js
const {start} = require('@shelf/postgres-local');

await start({
  seedPath: "schema.sql",
  version: 17,
  port: 5555,
  includeInstallation: true,
  debugMode: false
});
```
 - `seedPath` - absolute path to sql file with commands that will set up db structure before tests
 - `includeInstallation`
   - when this flag is `true` (default) macOS will run `brew install` and linux `apt install` to make sure `postgres` is installed
   - when false - package omit installing postgres and relly that it is already in place
 - `debugMode` - used for streaming terminal logs during executing `start` and `stop` methods
### 2. Stop Postgres

```js
import {stop} from '@shelf/postgres-local';

await stop({version: 17});
```



## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/prettier-config
Description: Reusable Prettier config
Author: Vlad Holubiev
Latest version: 1.1.1

# prettier-config

> Reusable Prettier config with a parallel Oxfmt export for migrations.

## Install

```sh
pnpm add --save-dev --save-exact @shelf/prettier-config
```

## Legacy Prettier Usage

Keep using the package root while a repo still formats through Prettier:

```json
{
  "prettier": "@shelf/prettier-config"
}
```

The legacy Prettier config stays published at the package root for non-migrated repos.

## Oxfmt Usage

For migrated repos, add a local `oxfmt.config.ts` and import the shared config from `@shelf/prettier-config/oxfmt`:

```ts
import baseConfig, {
  recommendedIgnorePatterns,
} from '@shelf/prettier-config/oxfmt';

export default {
  ...baseConfig,
  ignorePatterns: [...recommendedIgnorePatterns],
};
```

## Shared Oxfmt Config

```js
{
  printWidth: 100,
  singleQuote: true,
  bracketSpacing: false,
  trailingComma: 'es5',
  arrowParens: 'avoid',
  sortPackageJson: false,
}
```

`recommendedIgnorePatterns` starts intentionally small:

```js
['coverage/**']
```

Repo-specific ignore rules should stay local in each repo's `oxfmt.config.ts`.

## Migration Guide

The staged Oxfmt migration guide lives in [MIGRATING_TO_OXFMT.md](./MIGRATING_TO_OXFMT.md).

## Publish

```sh
pnpx np
```

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/pspdfkit-ssr
Description: Utilities to work with PSPDFKit's server-side rendering
Author: Vlad Holubiev
Latest version: 4.0.1

# pspdfkit-ssr [![CircleCI](https://circleci.com/gh/shelfio/pspdfkit-ssr/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/pspdfkit-ssr/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/pspdfkit-ssr.svg)](https://www.npmjs.com/package/@shelf/pspdfkit-ssr)

## Install

```
$ yarn add @shelf/pspdfkit-ssr
```

## Usage

```js
const {createReadStream} = require('fs');
const {uploadPDF, getJWTForDocumentPreview} = require('@shelf/pspdfkit-ssr');

const documentId = await uploadPDF({
  documentId: 'some-custom-document-id',
  fileStream: createReadStream('./file.pdf'),
  fileSize: 1024,
});

const jwt = getJWTForDocumentPreview(documentId);
```

**Note:** this library relies upon following environment variables:

- `PSPDFKIT_SERVER_URL`
- `PSPDFKIT_SERVER_AUTH_TOKEN`
- `PSPDFKIT_SERVER_JWT_KEY`
- `PSPDFKIT_SERVER_JWT_PASSPHRASE`

**Note:** this library tries to be idempotent.
Unlike PSPDFKit server, it catches errors when document with provided ID was already uploaded.

See [Client Authentication](https://pspdfkit.com/guides/server/current/pspdfkit-server/client-authentication/)
section of PSPDFKit documentation for details.

## Publish

- Run `sudo npx np`, follow interactive UI. Please select appropriate version bump according to [semver](https://semver.org/).

- After redirect to the prepared release of the early published package just press button `Publish release`

## License

MIT © [Shelf](https://shelf.io)
npm package: @shelf/quotation-marks-regex
Description: Regular expression for matching quotation marks
Author: Vlad Holubiev
Latest version: 0.1.1

# quotation-marks-regex [![CircleCI](https://circleci.com/gh/shelfio/quotation-marks-regex/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/quotation-marks-regex/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/quotation-marks-regex.svg)](https://www.npmjs.com/package/@shelf/quotation-marks-regex)

> Regular expression for matching quotation marks ([source](https://en.wikipedia.org/wiki/Quotation_mark#Summary_table))

## Install

```
$ yarn add @shelf/quotation-marks-regex
```

## Usage

```js
const regex = require('@shelf/quotation-marks-regex');

const input = `"hello" 'hello' ,hello‘ «hello» ”hello” “hello“ ’hello’ ‚hello‛ „hello„ ‹hello›`;

// strip all quotation marks
const output = input.replace(new RegExp(regex, 'g'), '');
// => hello hello hello hello hello hello hello hello hello hello hello
```


## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```


## License

MIT © [Shelf](https://shelf.io)