8000 GitHub - sindresorhus/buf-indexof: Node.js 4 `buffer.indexOf()` ponyfill
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

sindresorhus/buf-indexof

Repository files navigation

Deprecated

Just use Buffer#indexOf(). It has been available since Node.js 4.


buf-indexof Build Status

Node.js Buffer#indexOf() ponyfill

Install

$ npm install --save buf-indexof

Usage

var bufIndexof = require('buf-indexof');

bufIndexof(new Buffer('unicorn'), 'corn');
//=> 3

API

See the buffer.indexOf() docs.

The only difference is that you pass in the buffer as the first argument instead of calling the .indexOf() method on the buffer instance.

Related

License

MIT © Sindre Sorhus

About

Node.js 4 `buffer.indexOf()` ponyfill

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published
0