Socket
Socket
Sign inDemoInstall

buffer-replace

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    buffer-replace

Like String#replace but for buffers


Version published
Weekly downloads
12K
decreased by-39.21%
Maintainers
1
Install size
2.85 kB
Created
Weekly downloads
 

Readme

Source

buffer-replace

Like String#replace, but for buffers.

Usage

const replace = require('buffer-replace');

replace(Buffer('foo:bar'), ':', '-')
// Buffer('foo-bar')

replace(Buffer('foo-beep-bar'), '-beep-', '-');
// Buffer('foo-bar')

replace('foo-beep-bar', '-beep-', '-');
// Buffer('foo-bar')

Installation

$ npm install buffer-replace

API

replace(buf, a, b)

Replace all occurences of a in buf with b. All arguments can be either buffers or strings, but the return value is always a buffer.

License

MIT

FAQs

Last updated on 10 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc