@E18e/Data View Buffer

1.0.5Last update Aug 9, 2024
by@e18e

Data View Buffer Codemod

Introduction

This codemod replaces the usage of the data-view-buffer package with the built-in DataView API. It removes the import statement for the external dependency and transforms the corresponding instance property calls to directly utilize the native DataView feature, enhancing performance and reducing bundle size.

Before

import DataViewBuffer from 'data-view-buffer';
const buffer = DataViewBuffer(data);

After

const buffer = new DataView(data).buffer;

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now