All Projects → kevva → splice-buffer

kevva / splice-buffer

Licence: MIT license
Remove or replace part of a Buffer like Array#splice

Programming Languages

javascript
184084 projects - #8 most used programming language

splice-buffer Build Status

Remove or replace part of a Buffer like Array#splice

Install

$ npm install splice-buffer

Usage

const spliceBuffer = require('splice-buffer');

spliceBuffer('unicorn', 3, 4, 'verse');
//=> 'universe'

API

spliceBuffer(input, index, count, [insert])

input

Type: Buffer

index

Type: number

Index to start splicing.

count

Type: number

Number of characters to remove.

insert

Type: string

String to insert in place of the removed Buffer.

Related

License

MIT © Kevin Mårtensson

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].