URL
Install freaky through npm or yarn
npm i freaky
const freaky = require('freaky')
Checking the URL status and redirect the client to another URL if necessary.
Example:
// You can use this module by calling the freaky function,
// passing the link's URL and the redirect URL as arguments.
freaky.checkLink('https://example.com/nonexistent-page', 'https://example.com/404-page');
freaky.checkLinkOnBeforeUnload('https://example.com/nonexistent-page', 'https://example.com/404-page');
freaky.checkLinkOnPopState('https://example.com/nonexistent-page', 'https://example.com/404-page');