| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-08-06 | 1.7 kB | |
| v9.0.0 - Deno_JSR first source code.tar.gz | 2026-08-06 | 25.1 kB | |
| v9.0.0 - Deno_JSR first source code.zip | 2026-08-06 | 52.1 kB | |
| Totals: 3 Items | 79.0 kB | 2 | |
- Rewrite in TypeScript, with Deno/JSR as primary target
- Allow consumer to custom fetcher (replace old fetchOptions)
- Simplify html sanitizing with built-in function (remove sanitize-html dependency and related config methods)
- Fix JSON-LD logic (#425)
Breaking changes
Use custom fetcher instead of fetchOptions
Before v9.0.0:
:::js
import { extract } from '@extractus/article-extractor'
const url = 'https://example.com/some-article'
const article = await extract(url, {}, {
headers: {
'user-agent': 'Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1'
}
})
Since v9.0.0:
:::js
const myFetcher = (url: string) =>
fetch(url, {
headers: {
"user-agent": "Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1",
},
});
const article = await extract("https://example.com/some-article", {}, myFetcher);
Configure content sanitizing via parserOptions
Before v9.0.0:
:::js
import { setSanitizeHtmlOptions } from '@extractus/article-extractor'
setSanitizeHtmlOptions({
allowedAttributes: {
a: ["href", "target", "title"],
img: ["src", "srcset", "alt", "title"],
code: ["class"],
div: ["class"],
},
})
Since v9.0.0:
:::js
import { extract } from "jsr:@extractus/article-extractor";
const article = await extract(url, {
allowedAttributes: {
a: ["href", "target", "title"],
img: ["src", "srcset", "alt", "title"],
code: ["class"],
div: ["class"],
},
});
Check README for more detail.