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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cdmx/n8n-nodes-input-validator

v1.0.9

Published

The **n8n-nodes-input-validator** is a powerful tool designed to validate input data against specified criteria. It supports multiple data types, including strings, numbers, booleans, dates, and enums, and offers various validation options to ensure data

Downloads

208

Readme

n8n-nodes-input-validator

The n8n-nodes-input-validator is a powerful tool designed to validate input data against specified criteria. It supports multiple data types, including strings, numbers, booleans, dates, and enums, and offers various validation options to ensure data integrity.

Features

  • String Validation: Validate strings with options for email, URL, UUID, and regex pattern.
  • Number Validation: Validate numbers with options for minimum and maximum values.
  • Boolean Validation: Validate boolean values.
  • Date Validation: Validate dates in ISO 8601 format.
  • Enum Validation: Validate values against a set of predefined options.

Usage

Properties

The node allows you to configure multiple input fields with various validation criteria. Each input field has the following properties:

  • Validation Type: The type of validation to perform (string, number, boolean, date, enum).
  • Required: Whether the input field is required.
  • String Data: Data to be validated as a string.
  • String Format: Specify if the string should be validated as an email, URL, UUID, or match a custom pattern.
  • Number Data: Data to be validated as a number.
  • Boolean Data: Data to be validated as a boolean.
  • Date Data: Data to be validated as a date.
  • Enum Values: Comma-separated list of valid enum values.
  • Pattern: Regex pattern for string validation.
  • Min: Minimum value for number validation.
  • Max: Maximum value for number validation.

Example Configuration

Here's an example of how to configure the Validator Node:

  1. String Validation

  2. Number Validation

    • Validation Type: number
    • Required: true
    • Number Data: 10
    • Min: 2
    • Max: 100
  3. Boolean Validation

    • Validation Type: boolean
    • Required: true
    • Boolean Data: true
  4. Date Validation

    • Validation Type: date
    • Required: true
    • Date Data: 2024-06-05
  5. Enum Validation

    • Validation Type: enum
    • Required: true
    • String Data: option1
    • Enum Values: option1, option2, option3

Validation Logic

The validation logic is implemented as follows:

  • String Validation: Checks if the string matches the specified format (email, URL, UUID, pattern) and if it is not empty when required.
  • Number Validation: Checks if the number is within the specified range (min and max) and if it is a valid number.
  • Boolean Validation: Checks if the value is a valid boolean and if it is not empty when required.
  • Date Validation: Checks if the date is in ISO 8601 format and if it is not empty when required.
  • Enum Validation: Checks if the value is one of the predefined enum options and if it is not empty when required.

Error Handling

The node returns a JSON object with the following structure:

{
    "isValid": true,
    "errors": [
        {
            "field": "field_name",
            "message": "Error message"
        }
    ]
}
  • isValid: Indicates whether all validations passed.
  • errors: An array of error messages for failed validations.

Development

Setup

  1. Clone the repository.
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build