Socket
Socket
Sign inDemoInstall

clone-buffer

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    clone-buffer

Easier Buffer cloning in node.


Version published
Weekly downloads
2.2M
decreased by-17.92%
Maintainers
1
Install size
5.17 kB
Created
Weekly downloads
 

Package description

What is clone-buffer?

The clone-buffer npm package is designed to create a clone of a buffer. It is particularly useful in situations where you need to manipulate or use a buffer without altering the original data. This package provides a straightforward and efficient way to duplicate buffer objects, ensuring that operations on the cloned buffer do not affect the original buffer.

What are clone-buffer's main functionalities?

Cloning a Buffer

This feature allows you to clone a buffer. The code sample demonstrates how to clone a buffer containing the string 'Hello, world!' and then print the cloned buffer's content to the console. The cloned buffer is a separate instance, and modifications to it will not affect the original buffer.

const cloneBuffer = require('clone-buffer');
const buffer = Buffer.from('Hello, world!');
const clonedBuffer = cloneBuffer(buffer);
console.log(clonedBuffer.toString()); // 'Hello, world!'

Other packages similar to clone-buffer

Readme

Source

clone-buffer

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Easier Buffer cloning in node.

Example

var cloneBuffer = require('clone-buffer');

var buffer = new Buffer('test');
var cloned = cloneBuffer(buffer);
// buffer !== cloned

API

cloneBuffer(buffer)

Takes a Buffer object and returns a clone. Throws if a non-Buffer is passed.

License

MIT

Keywords

FAQs

Last updated on 25 Sep 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