npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-json-extract

v1.1.0

Published

n8n node to extract and parse JSON from AI-generated text

Downloads

431

Readme

n8n-nodes-json-extract

AI生成テキストから JSON を自動抽出・パースする n8n カスタムノード。完全自動、設定不要。

n8n node to extract and parse JSON from AI-generated text. Fully automatic, zero configuration.

Installation

npm install n8n-nodes-json-extract

Features

  • Automatic pattern detection - Tries multiple extraction patterns and stops at first success:
    1. Markdown code blocks: ```json ... ```
    2. JSON objects: { ... }
    3. JSON arrays: [ ... ]
  • Dual outputs - Success/Fail branches for explicit error handling
  • Fixed output format - Consistent structure across all results
  • Object input support - Pass through already-parsed JSON objects
  • Zero configuration - Only one parameter: Text
  • Duplicate removal - Automatically removes duplicate JSON objects

Output Format

All outputs (Success and Fail) use the same structure:

Success output (Output 1):

{
  "source": "AI response: Here is the user data: {\"name\":\"太郎\",\"age\":30}",
  "isSuccess": true,
  "errorMessage": null,
  "jsons": [
    { "name": "太郎", "age": 30 }
  ],
  "count": 1,
  "first_json": { "name": "太郎", "age": 30 },
  "last_json": { "name": "太郎", "age": 30 },
  "largest_json": { "name": "太郎", "age": 30 }
}
  • isSuccess: true
  • errorMessage: null
  • jsons: Array of extracted JSON objects/arrays
  • count: Number of extracted JSONs
  • first_json: First extracted JSON (or null if none)
  • last_json: Last extracted JSON (or null if none)
  • largest_json: Largest JSON by string size (or null if none)

Fail output (Output 2):

{
  "source": "No JSON found in this text",
  "isSuccess": false,
  "errorMessage": "No valid JSON found in text",
  "jsons": [],
  "count": 0,
  "first_json": null,
  "last_json": null,
  "largest_json": null
}
  • isSuccess: false
  • errorMessage: Error description
  • jsons: []
  • count: 0
  • All extra fields are null

Usage

  1. Add the "JSON Extract" node to your workflow
  2. Connect text input from AI agents (Claude, ChatGPT, Gemini, etc.)
  3. Enter text or use expressions like {{ $json.output }}
  4. Connect Success/Fail outputs to different branches

Example workflow:

AI Agent → JSON Extract → [Success] → Process Data
                       → [Fail] → Error Handler

Use Cases

  • Extract JSON from AI chat responses
  • Parse structured data from unstructured text
  • Handle AI output with mixed text and JSON
  • Extract multiple JSON objects from single response

Version History

  • v1.1.0 - Added convenience fields: count, first_json, last_json, largest_json
  • v1.0.0 - Automatic pattern detection, zero configuration
  • v0.6.0 - Removed Extraction Mode parameter
  • v0.5.0 - Fixed output format
  • v0.4.0 - Removed On Parse Error parameter
  • v0.3.0 - Added Success/Fail dual outputs
  • v0.2.0 - Changed to direct text input

License

MIT