> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/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={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{"html": "This is a sentence."}
{"html": "This is another sentence."}
```

示例代码：

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
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.",
  },
]
*/
```

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\oss\javascript\integrations\document_loaders\file_loaders\jsonlines.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
