angular-statisfy
v2.0.0
Published
Prerender an Angular application into static HTML for crawlers
Downloads
7
Maintainers
Readme
Angular statisfy
This library renders your application, strips the script tags, and returns the static HTML for a given URL. The generated HTML can be used to serve spiders and crawlers in order to improve SEO.
Originally made for Angular but works for any single page applications or website.
Install
Install the library using yarn add angular-statisfy
.
Usage
The default usage of statisfy can be found in the code below.
import {launch} from 'puppeteer';
import {generateStaticHtml} from './generate-static';
(async () => {
const browser = await launch({
args: ['--no-sandbox'],
});
const html = await generateStaticHtml('https://bookingworldspeakers.com', browser);
await browser.close();
})().catch(console.error);