New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

buffer-esm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-esm

A cross-platform, partial implementation shim of Node Buffer.

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
3.2K
23.69%
Maintainers
1
Weekly downloads
 
Created
Source

Buffer-ESM

A cross-platform, partial implementation shim of Node Buffer. Supports encoding and decoding strings.

Usage

Install via NPM and require in your project. There is also an ESM export, for use with browser or Deno.

const { BufferShim } = require('buffer-esm')

const buffer = BufferShim.from('These are the voyages...') // Assumes utf8 when no encoding is passed.
const firstByte = buffer[0] // 84
const base64 = buffer.toString('base64') // VGhlc2UgYXJlIHRoZSB2b3lhZ2VzLi4u
const utf8 = buffer.toString('utf8') // These are the voyages...

Keywords

buffer

FAQs

Package last updated on 21 Aug 2020

Did you know?

Socket

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