Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

save-buffer

1.3.1 • Public • Published

save-buffer

Build Status

Turn a buffer into a file

Install

npm install --save save-buffer

Usage

const imageDownload = require('image-download');
const saveBuffer = require('save-buffer');
 
(async () => {
  const buffer = await imageDownload('https://www.fillmurray.com/g/200/300');
  const result = await saveBuffer(buffer, './new/file/path.jpg');
})();

API

saveBuffer(buffer, filePath)

Returns a Promise. The returned value is undefined or an error message.

buffer

Type: Buffer

filePath

Type: string

Related

License

MIT © Patrick Tone

Install

npm i save-buffer

DownloadsWeekly Downloads

26

Version

1.3.1

License

MIT

Unpacked Size

3.1 kB

Total Files

4

Last publish

Collaborators

  • avatar