clearnote01 / readability

npm package to calculate readability statistics of a text object - paragraphs, sentences, articles.
MIT License
73 stars 13 forks source link

Using in simple HTML page #15

Open Ciao121 opened 7 months ago

Ciao121 commented 7 months ago

Hi, I find no way to use it in a simpe html page (index.html)... no React, vo Vues. That's because my very low experience with es modules and how to use them in a browser. Is there any example I can find somewhere? Thank you!!!

Ciao121 commented 7 months ago

This is my attempt: <script type="module"> import { rs } from './node_modules/text-readability/main.js' </script> main.js is loaded with http 200 code but I get: Uncaught TypeError: Failed to resolve module specifier "syllable". Relative references must start with either "/", "./", or "../". I can change in main.js: import { syllable } from 'syllable'; to import { syllable } from './node_modules/syllable/index.js' but then I get another one.. and another one..