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-extractor

v0.1.0

Published

n8n node for extracting and parsing JSON from text

Readme

N8N JSON Extractor Node

A custom n8n node for extracting and parsing JSON data from text content. This node is particularly useful when working with API responses, log files, or any text that contains embedded JSON data.

Features

  • Multiple extraction modes: Extract JSON using different strategies
  • Flexible parsing: Handle various JSON formats and structures
  • Error handling: Graceful handling of malformed JSON with optional continuation
  • Easy integration: Simple installation and configuration

Installation

Via npm (Recommended)

npm install n8n-nodes-json-extractor

Manual Installation

  1. Clone this repository
  2. Install dependencies: npm install
  3. Build the node: npm run build
  4. Link to your n8n installation: npm link

Usage

After installation, the JSON Extractor node will be available in your n8n workflow editor under the "Transform" category.

Node Configuration

The node provides the following configuration options:

Input Text

  • Type: String (multiline)
  • Required: Yes
  • Description: The text content from which to extract JSON data

Extract Mode

Choose how the JSON should be extracted from the input text:

  1. Outer Curly Braces (default)

    • Extracts JSON between the outermost { and } braces
    • Ideal for text with JSON embedded within other content
    • Example: "Some text {\"key\": \"value\"} more text"{\"key\": \"value\"}
  2. Full Text

    • Treats the entire input as JSON
    • Use when your input is pure JSON
    • Example: {\"key\": \"value\"}{\"key\": \"value\"}
  3. Regular Expression

    • Uses a custom regex pattern to extract JSON
    • Provides maximum flexibility for complex extraction scenarios
    • Requires a valid regex pattern in the "Regular Expression" field

Regular Expression

  • Type: String
  • Visible: Only when "Extract Mode" is set to "Regular Expression"
  • Default: \\{[^]*\\}
  • Description: Custom regex pattern for JSON extraction

Output

The node outputs an object containing:

  • extracted: The raw extracted JSON string
  • parsed: The parsed JSON object
  • All properties from the parsed JSON are also available at the root level

Example Output

Input text: "API Response: {\"status\": \"success\", \"data\": {\"id\": 123}}"

Output:

{
  "extracted": "{\"status\": \"success\", \"data\": {\"id\": 123}}",
  "parsed": {
    "status": "success",
    "data": {
      "id": 123
    }
  },
  "status": "success",
  "data": {
    "id": 123
  }
}

Use Cases

  • API Response Processing: Extract JSON from HTTP response bodies that contain additional text
  • Log File Analysis: Parse JSON logs embedded in text files
  • Data Transformation: Convert text-based data sources containing JSON
  • Web Scraping: Extract JSON data from HTML pages or JavaScript variables
  • Configuration Parsing: Extract JSON configuration from mixed-format files

Error Handling

The node includes robust error handling:

  • Invalid JSON: Clear error messages when JSON parsing fails
  • No Match Found: Informative errors when extraction patterns don't match
  • Continue on Fail: Option to continue workflow execution even when errors occur

Development

Building

npm run build

Watching for Changes

npm run build:watch

Formatting

npm run format

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

License

MIT

Support

If you encounter any issues or have questions, please create an issue in the GitHub repository.