# @pelevesque/remove-offsets

> Removes and returns offsetted strings from an array.

Latest version **1.0.5** (published 2020-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pelevesque/remove-offsets
pnpm add @pelevesque/remove-offsets
yarn add @pelevesque/remove-offsets
bun add @pelevesque/remove-offsets
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-02-12 |
| First published | 2019-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=9.0.0 |
| Dependencies | 1 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pierre-Emmanuel Lévesque |
| Maintainers | pelevesque |
| Keywords | string, remove, offset, offsetted |

## Links

- npm: https://www.npmjs.com/package/@pelevesque/remove-offsets
- Repository: https://github.com/pelevesque/remove-offsets
- Homepage: https://github.com/pelevesque/remove-offsets#readme
- Issues: https://github.com/pelevesque/remove-offsets/issues
- npm.io page: https://npm.io/package/@pelevesque/remove-offsets

## Dependencies (1)

- [@pelevesque/is-offset](https://npm.io/package/@pelevesque/is-offset.md) ^0.0.8

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2020-02-12
- 1.0.4 — 2019-07-22
- 1.0.3 — 2019-06-21
- 1.0.2 — 2019-06-18
- 1.0.1 — 2019-06-18
- 1.0.0 — 2019-06-18
- 0.1.0 — 2019-06-14
- 0.0.2 — 2019-05-25
- 0.0.1 — 2019-05-25

## README

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

# remove-offsets

Removes and returns offsetted strings from an array.

## Node Repository

https://www.npmjs.com/package/@pelevesque/remove-offsets

## Installation

`npm install @pelevesque/remove-offsets`

## 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

### Parameters

```js
arr     (required)
options (optional) default = { step: 1, remove: true }
```

### Requiring

```js
const removeOffsets = require('@pelevesque/remove-offsets')
```

### Basic

```js
const arr = [
  'abcdef',
  '123456',
  'defabc', // 0
  'apple',
  '234561', // 1
  'banana',
  '456123', // 1
  'panama',
  'amapan' // 7
]
const offsets = removeOffsets(arr)
/*
arr = [
  'abcdef',
  '123456',
  'apple',
  'banana',
  'panama'
]
offsets = [
  'defabc',
  '234561',
  '456123',
  'amapan'
]
*/
```

### Step Option

```js
// Only check for offsets every 4 steps
const arr = [
  '123456789',
  'aaaabbbbb',
  'abbbbbaaa',
  'bbbbbaaaa', // 1
  '234567891', // 0
  '678912345', // 0
  '912345678'
]
const offsets = removeOffsets(arr, { step: 4 })
/*
arr = [
  '123456789',
  'aaaabbbbb',
  'abbbbbaaa',
  '912345678'
]
offsets = [
  'bbbbbaaaa',
  '234567891',
  '678912345'
]
*/
```

### Remove Option

With the remove option set to false, offsets are still returned, but nothing is
removed from the original array.

```js
// Only check for offsets every 4 steps
const arr = [
  '123456789',
  'aaaabbbbb',
  'abbbbbaaa',
  'bbbbbaaaa', // 1
  '234567891', // 0
  '678912345', // 0
  '912345678'
]
const offsets = removeOffsets(arr, { step: 4, remove: false })
/*
arr = [
  '123456789',
  'aaaabbbbb',
  'abbbbbaaa',
  'bbbbbaaaa',
  '234567891',
  '678912345',
  '912345678'
]
offsets = [
  'bbbbbaaaa',
  '234567891',
  '678912345'
]
*/
```

---
_Source: https://npm.io/package/@pelevesque/remove-offsets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
