html-extract / hext

Domain-specific language for extracting structured data from HTML documents
https://hext.thomastrapp.com
Apache License 2.0
52 stars 3 forks source link

Add native releases for Mac OS on M1/M2 #26

Closed thomastrapp closed 1 year ago

thomastrapp commented 1 year ago

Currently there are no releases for Mac OS on the M1/M2 architecture, i.e. npm install hext and pip install hext will find no suitable release.

Popularity of M1 and M2 will increase over time and therefore Hext should provide releases for the new Apple hardware.

Workarounds

Hext does support ARM64, but unfortunately must be compiled from source.

Another alternative is to use Hext.js. Hext.js is a JavaScript/WebAssembly module that runs on Node on any architecture (Documentation)

Install hext.js:

$ npm install hext.js

Example application test.js:

const loadHext = require('hext.js');

loadHext().then(hext => {
  const html = new hext.Html("<ul><li>Hello</li><li>World</li></ul>");
  const rule = new hext.Rule("<li @text:my_text />");
  const result = rule.extract(html).map(x => x.my_text).join(", ");
  console.log(result); // "Hello, World"
});
$ node test.js
Hello, World
thomastrapp commented 1 year ago

This was fixed with the latest release, Hext v1.0.8.