
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
一个强大的网页内容提取库,支持多种格式和编码,可以将网页内容转换为结构化的 Markdown 格式。
npm install ohmyreader
# 或
bun add ohmyreader
import { extractContent } from 'ohmyreader';
// 简单用法
const result = await extractContent('https://example.com/article');
// 或使用链式调用
import { Reader } from 'ohmyreader';
const result = await new Reader()
.from('https://example.com/article')
.extract();
import { Reader } from 'ohmyreader';
const result = await new Reader()
.from('https://example.com/article')
.withValidation({
enabled: true,
minLength: 100,
maxNavRatio: 0.3
})
.withRequestOptions({
timeout: 5000,
retries: 3,
headers: {
'User-Agent': 'Custom User Agent'
}
})
.withExtractOptions({
preferParser: true,
includeComments: true,
includeMeta: true
})
.extract();
const result = await extractContent('https://example.com/article', {
validate: {
enabled: true,
minLength: 100,
maxNavRatio: 0.3
},
request: {
timeout: 5000,
retries: 3,
headers: {
'User-Agent': 'Custom User Agent'
}
},
extract: {
preferParser: true,
includeComments: true,
includeMeta: true
}
});
interface ExtractOptions {
// 内容验证选项
validate?: {
enabled?: boolean; // 是否启用内容验证
minLength?: number; // 最小内容长度
maxNavRatio?: number; // 最大导航内容比例
};
// 网络请求选项
request?: {
timeout?: number; // 超时时间(毫秒)
retries?: number; // 重试次数
headers?: HeadersInit; // 自定义请求头
};
// 提取选项
extract?: {
includeComments?: boolean; // 是否包含评论
preferParser?: boolean; // 是否优先使用 Parser
includeMeta?: boolean; // 是否包含元数据
};
}
interface ExtractResult {
title: string; // 文章标题
author: string; // 作者
publishDate: string; // 发布日期
markdown: string; // Markdown 格式的正文
excerpt: string; // 摘要
leadImageUrl?: string | null; // 主图 URL
domain?: string; // 域名
wordCount?: number; // 字数统计
url: string; // 原始 URL
}
try {
const result = await new Reader()
.from('https://example.com/article')
.extract();
} catch (error) {
if (error.message.includes('URL未设置')) {
// 处理 URL 错误
} else if (error.message.includes('提取失败')) {
// 处理提取失败
} else if (error.message.includes('网络错误')) {
// 处理网络错误
}
}
欢迎提交 Issue 和 Pull Request!
MIT
FAQs
A powerful web content extractor that converts articles to clean markdown
The npm package ohmyreader receives a total of 2 weekly downloads. As such, ohmyreader popularity was classified as not popular.
We found that ohmyreader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.