Skip to content

Feature request: Start releaseing browser versions of binary-parser #280

Description

@rain1

Make a version of it that does not need NodeJS but that can be used like that:

<!DOCTYPE html>
<html>
<head>
  <script src="binary-parser.js"></script>
</head>
<body>
  <script>
    const parser = new Parser();
    // do stuff with parser 
  </script>
</body>
</html>

I could technically use it like that:

  <script type="module">
    import { Parser } from "https://cdn.skypack.dev/binary-parser@2.2.1";

    const parser = new Parser();
    // do stuff with parser 
  </script>

But that forces me to load it from server even if I open html file from my local disk. <script src="binary-parser.js" from the other hand works fine when file is opened locally.

So it would be cool to have version that I can simply load with <script src="binary-parser.js".

Update: Currently I found this hack to use it with <script src="binary-parser.js" :

  1. Get script from https://cdn.jsdelivr.net/npm/binary-parser@2.2.1/dist/binary_parser.js
  2. Remove the following lines from the start
Object.defineProperty(exports, "__esModule", { value: true });
exports.Parser = void 0;
  1. Remove the following lines from the end
exports.Parser = Parser;
//# sourceMappingURL=binary_parser.js.map

Or alternatively browserify could be used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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