Function insertText

  • Add a string of HTML to an HTML document.

    Parameters

    • filePath: string
    • options: InsertBeforeFirstOptions

    Returns Promise<void>

    Example

    the before option is to insert HTML before the first tag specified -- link in this case.

    import { html } from 'ember-apply';

    await html.insertText('app/index.html', {
    text: `<link integrity="" rel="stylesheet" href="{{rootURL}}assets/tailwind.css">`,
    beforeFirst: 'link',
    });