包详细信息

buf-indexof

sindresorhus414MIT不推荐使用2.0.0

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

Node.js buffer.indexOf() ponyfill

builtin, core, ponyfill, polyfill

自述文件

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