# buffer-indexof

> find the index of a buffer in a buffer

Latest version **1.1.1** (published 2017-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install buffer-indexof
pnpm add buffer-indexof
yarn add buffer-indexof
bun add buffer-indexof
```

## 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.1.1 |
| Published | 2017-08-22 |
| First published | 2013-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Ryan Day |
| Maintainers | soldair |

## Links

- npm: https://www.npmjs.com/package/buffer-indexof
- Repository: https://github.com/soldair/node-buffer-indexof
- Homepage: https://github.com/soldair/node-buffer-indexof#readme
- Issues: https://github.com/soldair/node-buffer-indexof/issues
- npm.io page: https://npm.io/package/buffer-indexof

## Recent versions

- 1.1.1 (latest) — 2017-08-22
- 1.1.0 — 2016-09-15
- 1.0.2 — 2016-08-30
- 1.0.1 — 2016-08-29
- 1.0.0 — 2015-08-10
- 0.0.2 — 2014-08-22
- 0.0.1 — 2013-09-19
- 0.0.0 — 2013-09-18

## README

[![Build Status](https://secure.travis-ci.org/soldair/node-buffer-indexof.png)](http://travis-ci.org/soldair/node-buffer-indexof)
 

buffer-indexof
===================

find the index of a buffer in a buffer. should behave like String.indexOf etc.

```js

var bindexOf = require('buffer-indexof');

var newLineBuffer = new Buffer("\n");

var b = new Buffer("hi\nho\nsilver");


bindexOf(b,newLineBuffer) === 2

// you can also start from index

bindexOf(b,newLineBuffer,3) === 5

// no match === -1

bindexOf(b,newLineBuffer,6) === -1


```

CHANGELOG
----------

- 1.0.0
  - fixed issue finding multibyte needles in haystack.  thanks @imulus
- 1.0.1
  - fixed failing to find partial matches as pointed out by @bahaa-aidi in #2

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