Netlify-sdk V0.8.1 - Rename addBuildEventHandler

This codemod renames addBuildHook to addBuildEventHandler as required in Netlify SDK v0.8.1.

Netlify SDK
jscodeshift
Estimated time saving
~1 minutes/occurrence
Change mode
Autonomous
Applicability criteria

Netlify SDK v0.8.1 or higher.

Made by
Codemod.com
Codemod.com

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod netlify/0.8.1/addBuildEventHandler
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Description

This codemod renames addBuildHook to addBuildEventHandler as required in Netlify SDK v0.8.1.

Before

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
// Adding a build event handler integration.addBuildHook('onPreBuild', () => {
	console.log('This is my first build event handler!');
});

After

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
// Adding a build event handler integration.addBuildEventHandler('onPreBuild', () => {
	console.log('This is my first build event handler!');
});