How to use the node-html-parser.TextNode function in node-html-parser

To help you get started, we’ve selected a few node-html-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spderosso / deja-vu / packages / schematics / src / component / index.ts View on Github external
}

    const title = `${strings.capitalize(options.type)} ` +
      `${strings.capitalize(options.entityName)}`;
    const componentHtml =
      `  <h2>${title}</h2>\n` +
      `  &lt;${componentComponentSelector}&gt;\n`;

    const container = root.querySelector('div.container');
    if (!container) {
      console.log('Could not find div with class container, ' +
        `skipping update to ${filePath}`);
      return tree;
    }

    container.appendChild(new TextNode(componentHtml));
    tree.overwrite(filePath, root.toString());

    return tree;
  };
}

node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.

MIT
Latest version published 1 month ago

Package Health Score

82 / 100
Full package analysis