@E18e/Is Windows

1.0.5Last update Aug 9, 2024
by@e18e

is-windows Codemod

Introduction

This codemod removes the dependency on the is-windows npm package by replacing its usage with a built-in Node.js feature. It converts calls to is-windows() into a direct comparison of process.platform with 'win32', reducing unnecessary dependencies and improving performance.

Before

import isWindows from 'is-windows';
if (isWindows()) {
console.log('Running on Windows');
}

After

if (process.platform === 'win32') {
console.log('Running on Windows');
}

Build custom codemods

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

background illustrationGet Started Now