node-html-to-text icon indicating copy to clipboard operation
node-html-to-text copied to clipboard

Documentation on how to use outside of Node (in the browser / Deno)

Open lino-levan opened this issue 2 years ago • 3 comments

Problem to solve I would love to use html-to-text in Deno.

What works I can kind of hack this in by using esm.sh, but it's not ideal.

What is missing A native ESM / Deno version using web APIs would be nice

How the missing feature should be implemented Not entirely sure, I don't imagine it would take a lot of work since I don't see a reason to use node-specific APIs.

Bigger picture I think that ESM modules are the future of javascript in general, so either converting this module to ESM, releasing a build with ESM, or improving docs on how to import this using web standard imports would be nice.

lino-levan avatar May 09 '23 18:05 lino-levan

What exact problem you have with ESM? As of 9.0.0, html-to-text is already a mixed mode package and uses ESM syntax internally.

html-to-text doesn't depend on Node APIs anymore - it is used in web projects successfully.

html-to-text depends on some packages that are not in Deno. Some are not maintained by me and have little prospect to be moved forward in any way by maintainers.

I know Deno has introduced Node dependencies support, but I don't know whether I should be bothered to explore that, since that should also allow you to reference html-to-text.

KillyMXI avatar May 09 '23 18:05 KillyMXI

It appears that esm.sh works very well for this package, so I guess this issue is more "please write documentation on how to use outside of node (in the browser / Deno)". Rather than a "this doesn't work please fix".

lino-levan avatar May 09 '23 19:05 lino-levan

Ok. I basically have no idea what to write though. Making a website for html-to-text is in the backlog, but I don't know when it will happen. Despite having some my packages in Deno, I don't have Deno-first projects and unfamiliar with idiomatic ways to do things there.

Rewriting the documentation - planned, but no ETA. Although this can be taken as I shouldn't be worried much about current Readme content, and it can be a field for experimentation.

Anyone can also just write down how-tos/recipes in Discussions.

But I withhold from using the "help wanted" badge, because even managing contributions can bring too much anxiety in the current situation.

KillyMXI avatar May 09 '23 19:05 KillyMXI