8000 HTMLParser is not defined · Issue #16 · Jxck/html2json · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.
This repository was archived by the owner on Apr 10, 2024. It is now read-only.
HTMLParser is not defined #16
@obonyojimmy

Description

@obonyojimmy

Kindly include HTMLParser as a dependency to avoid node HTMLParser is not defined compilation errors in node ,

this line (line 5-7 ) :

if (typeof window === 'undefined') {
    require('../lib/Pure-JavaScript-HTML5-Parser/htmlparser.js');
  }

why not directly include the dependency either by checking if type is node module export as in below :

if (typeof module === "object" && typeof module.exports === "object") {
  require('../lib/Pure-JavaScript-HTML5-Parser/htmlparser.js');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0