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-text-shield

v1.1.0

Published

n8n community node for sanitize text input

Readme

n8n-text-shield

An n8n community node designed to sanitize text inputs, protecting your workflows from malicious code injection, including Cross-Site Scripting (XSS) and SQL Injection.

Features

  • XSS Protection: Sanitizes input text to remove malicious HTML and JavaScript code using the robust DOMPurify library.
  • SQL Injection Protection: Optionally sanitizes input text to prevent SQL injection attacks by removing common SQL statements using a regular expression. This feature can be toggled on or off.
  • Preserves Data Context: The node seamlessly integrates into your workflow by cloning the original data and adding the sanitized text as a new field, ensuring no data is lost.
  • Flexible Configuration: Allows you to specify which field to sanitize and what to name the new output field.
  • Integrated Error Handling: Works directly with n8n's built-in "Continue on Fail" setting for robust and straightforward error management.

Prerequisites

Ensure you have a running n8n instance. For installation instructions, refer to the n8n installation guide.

Installation

  1. Navigate to Settings > Community Nodes in your n8n instance.
  2. Select Install a community node.
  3. Enter n8n-text-shield as the NPM package name.
  4. Click Install.

You will need to restart your n8n instance for the node to become available in the editor.

How to Use

You can find the Text Shield node under the "Transform" category in the nodes panel.

Input Properties

  • Field to Sanitize: The field containing the text you wish to sanitize. This is typically an expression pulling data from a previous node (e.g., {{ $json.body.comment }}).
  • Output Field Name: The name for the new field that will be added to your data, containing the sanitized text. Defaults to sanitizedText.
  • Sanitize for SQL: A checkbox that is disabled by default. When active, the node will also escape the text, making it safer for use in SQL queries. This runs after the HTML/JS sanitization.

Outputs

  • The node has a single output. If the sanitization is successful, the original item is passed on with the new sanitized field added to it.

Error Handling

  • The node integrates with n8n's native error handling.

  • If "Continue on Fail" is OFF (default): The workflow will stop and show an error if sanitization fails for any item.

  • If "Continue on Fail" is ON: The workflow will continue. The item that failed will be passed on, but with an error object added to its JSON data, allowing for graceful error management in your workflow.

Core Dependencies

This node is built upon these excellent open-source libraries:

  • DOMPurify for XSS sanitization.
  • JSDOM to provide a virtual DOM environment for DOMPurify.

License

This project is licensed under the MIT License.