angular-statisfy

Prerender an Angular application into static HTML for crawlers

Usage no npm install needed!

<script type="module">
  import angularStatisfy from 'https://cdn.skypack.dev/angular-statisfy';
</script>

README

Angular statisfy

npm version Build Status License

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);