Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Deno Support #1442

Closed
bdearborn opened this issue Jul 8, 2020 · 6 comments
Closed

Feature Request: Deno Support #1442

bdearborn opened this issue Jul 8, 2020 · 6 comments

Comments

@bdearborn
Copy link

Any plans to support Deno?

https://deno.land/

@fb55
Copy link
Member

fb55 commented Sep 14, 2020

What would be required to make this work?

@fb55
Copy link
Member

fb55 commented Dec 8, 2020

Closing this due to an apparent lack of interest. Happy to revisit should someone be able to lead this effort.

@fb55 fb55 closed this as completed Dec 8, 2020
@niklaas
Copy link

niklaas commented Jan 16, 2021

I'm interested in this too. My gut feeling tells me that it shouldn't be too complicated because for an earlier version of cheerio someone already made it to work: https://github.com/justjavac/deno_cheerio. That said, I would need some support on this because I'm fairly new to both deno and cheerio.

@fb55
Copy link
Member

fb55 commented Jan 16, 2021

Just reading the diffs in the README (as that is the only part I can read), this seems to be primarily an issue with the use of the Buffer type, which has been removed. Happy to accept patches for any other necessary changes!

@justjavac
Copy link

Cheerio works in Deno with no-check flag.

import cheerio from "https://dev.jspm.io/npm:cheerio/index.js";

const $ = cheerio.load('<h2 class="title">Hello world</h2>');

$("h2.title").text("Hello Deno!");
$("h2").addClass("deno");

console.log($.html());

Run it:

> deno run --no-check mod.ts
<h2 class="title deno">Hello Deno!</h2>

What is not compatible with deno is the dts @types/cheerio.

@takker99
Copy link

Now Cheerio also works in Deno without no-check flag.
(using esm.sh instead of dev.jspm.io)

import cheerio from "https://esm.sh/cheerio@1.0.0-rc.10";

const $ = cheerio.load('<h2 class="title">Hello world</h2>');

$("h2.title").text("Hello Deno!");
$("h2").addClass("deno");

console.log($.html());
> deno run mod.ts
<html><head></head><body><h2 class="title deno">Hello Deno!</h2></body></html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants