find-embedded-documents

0.6.0 • Public • Published

find-embedded-documents

Finds all embedded CSS and JavaScript documents within an HTML string or codsen-parser AST.

Install

$ npm install find-embedded-documents

Usage

const findEmbeddedDocuments = require("find-embedded-documents");

const documents = findEmbeddedDocuments(`
  <style>body {background: blue;}</style>
`);
// => [ { tag: 'style', type: 'css', content: '', range: [...] } ]

API

findEmbeddedDocuments(html)

Accepts a string or AST generated by codsen-parser.

Returns an array of objects for each embedded document found.

/find-embedded-documents/

    Package Sidebar

    Install

    npm i find-embedded-documents

    Weekly Downloads

    1

    Version

    0.6.0

    License

    MIT

    Unpacked Size

    5.1 kB

    Total Files

    5

    Last publish

    Collaborators

    • avigoldman