> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-docs-zh.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Jsonlines 文件 - 集成

> 使用 LangChain JavaScript 集成 Jsonlines 文件 - 文档加载器。

这个示例介绍了如何从 JSONLines 或 JSONL 文件加载数据。第二个参数是一个 JSONPointer，用于提取文件中每个 JSON 对象的属性。文件中的每个 JSON 对象都会创建一个文档。

示例 JSONLines 文件：

```json theme={null}
{"html": "This is a sentence."}
{"html": "This is another sentence."}
```

示例代码：

```typescript theme={null}
import { JSONLinesLoader } from "@langchain/classic/document_loaders/fs/json";

const loader = new JSONLinesLoader(
  "src/document_loaders/example_data/example.jsonl",
  "/html"
);

const docs = await loader.load();
/*
[
  Document {
    "metadata": {
      "blobType": "application/jsonl+json",
      "line": 1,
      "source": "blob",
    },
    "pageContent": "This is a sentence.",
  },
  Document {
    "metadata": {
      "blobType": "application/jsonl+json",
      "line": 2,
      "source": "blob",
    },
    "pageContent": "This is another sentence.",
  },
]
*/
```

***

> 官方原文：[src/oss/javascript/integrations/document\_loaders/file\_loaders/jsonlines.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/javascript/integrations/document_loaders/file_loaders/jsonlines.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.