# @pelevesque/are-substrings-under-minimum-occurrences

> Checks if substrings are under minimum occurrences in a string.

Latest version **0.0.5** (published 2020-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pelevesque/are-substrings-under-minimum-occurrences
pnpm add @pelevesque/are-substrings-under-minimum-occurrences
yarn add @pelevesque/are-substrings-under-minimum-occurrences
bun add @pelevesque/are-substrings-under-minimum-occurrences
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2020-02-13 |
| First published | 2019-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=9.0.0 |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pierre-Emmanuel Lévesque |
| Maintainers | pelevesque |
| Keywords | str, string, substring, minimum, occurrences |

## Links

- npm: https://www.npmjs.com/package/@pelevesque/are-substrings-under-minimum-occurrences
- Repository: https://github.com/pelevesque/are-substrings-under-minimum-occurrences
- Homepage: https://github.com/pelevesque/are-substrings-under-minimum-occurrences#readme
- Issues: https://github.com/pelevesque/are-substrings-under-minimum-occurrences/issues
- npm.io page: https://npm.io/package/@pelevesque/are-substrings-under-minimum-occurrences

## Dependencies (1)

- [substr-occurrence](https://npm.io/package/substr-occurrence.md) ^1.1.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2020-02-13
- 0.0.4 — 2019-07-22
- 0.0.3 — 2019-07-01
- 0.0.2 — 2019-06-26
- 0.0.1 — 2019-06-26

## README

[![Build Status](https://travis-ci.org/pelevesque/are-substrings-under-minimum-occurrences.svg?branch=master)](https://travis-ci.org/pelevesque/are-substrings-under-minimum-occurrences)
[![Coverage Status](https://coveralls.io/repos/github/pelevesque/are-substrings-under-minimum-occurrences/badge.svg?branch=master)](https://coveralls.io/github/pelevesque/are-substrings-under-minimum-occurrences?branch=master)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

# are-substrings-under-minimum-occurrences

Checks if substrings are under minimum occurrences in a string.

## Related Packages

https://github.com/pelevesque/are-substrings-over-maximum-occurrences  
https://github.com/pelevesque/are-substrings-under-minimum-density  
https://github.com/pelevesque/are-substrings-over-maximum-density  

## Node Repository

https://www.npmjs.com/package/@pelevesque/are-substrings-under-minimum-occurrences

## Installation

`npm install @pelevesque/are-substrings-under-minimum-occurrences`

## Tests

Command                      | Description
---------------------------- | ------------
`npm test` or `npm run test` | All Tests Below
`npm run cover`              | Standard Style
`npm run standard`           | Coverage
`npm run unit`               | Unit Tests

## Usage

### Requiring

```js
const areSubstringsUnderMinimumOccurrences = require('@pelevesque/are-substrings-under-minimum-occurrences')
```

### One Check

```js
// under occurrences returns true
// 'a' has 4 occurrences, less than 8
const str = 'aaaabbbb'
const checks = { a: 8 }
const result = areSubstringsUnderMinimumOccurrences(str, checks)
// result === true
```

```js
// equal to occurrences returns false
const str = 'aaaabbbb'
const checks = { a: 4 }
const result = areSubstringsUnderMinimumOccurrences(str, checks)
// result === false
```

```js
// over occurrences returns false
const str = 'a man, a hog, and another hog'
const checks = { hog: 1 }
const result = areSubstringsUnderMinimumOccurrences(str, checks)
// result === false
```

### Multiple Checks

```js
// when one is under occurrences, it returns true ('a' is under 8)
const str = 'aaaabbbb'
const checks = { a: 8, b: 4 }
const result = areSubstringsUnderMinimumOccurrences(str, checks)
// result === true
```

```js
// when all are over or equal to occurrences, it returns false
const str = 'a man, a hog, and another hog'
const checks = { a: 1, hog: 1 }
const result = areSubstringsUnderMinimumOccurrences(str, checks)
// result === false
```

---
_Source: https://npm.io/package/@pelevesque/are-substrings-under-minimum-occurrences · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
