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

bfrp-bfr-validation-engine

v1.3.0

Published

[![Build Status](https://dev.azure.com/dfe-ssp/BFRP/_apis/build/status/CI%20Builds/BFRP-BFR-ValidationEngine-CI?branchName=develop)](https://dev.azure.com/dfe-ssp/BFRP/_build/latest?definitionId=415&branchName=develop)

Readme

Build Status

BFRP-BFR-ValidationEngine

Custom form data validation engine for BFRP-BFR application to be used with Javascript frameworks frontend or NodeJS server

This project was generated with yarn version 1.9.1. Babel v7.6.4 is being used to transpile ES6+ codes, and Jest v24.9.0 with code coverage reporter istanbul/nyc (built in with Jest) to run tests.

Getting Started

Prerequisites

Node v8+ is required.

yarn is preferred. If you prefer using npm as your package manager, replace yarn with npm in the commands below.

To develop/run the Azure functions serverless API of the validation engine locally, install version 2.x of the Azure Functions Core Tools.

Install packages

Run yarn install from project root to install all necessary packages.

Development with watch mode

Validation Engine

src/app contains code for the actual validation engine module. src/index.js is to run and check validation engine functionalities to speed up development

  1. Create a directory named mock in the project src directory and put a file named formData.json with sample form data.

  2. Run the following command to run the project in development mode. The project would re-run itself when there is any changes in .js files in src directory

yarn start

Validation API - Azure Functions

validation-api contains code for the validation engine serverless api. validation-api/ValidationEngine contains the distribution copy of the validation engine.

  1. From project root directory, run yarn build to build a production copy of the validation engine. It will also copy the code inside validation-api/ValidationEngine

  2. cd validation-api directory

  3. Create local.settings.json file with the content below. This also adds the validationFileNameTemplate variable that is used to load right validation configuration file. ENV and BFRTYPE variables used in the previous version of the validation engine are NOT used anymore.

{
 "IsEncrypted": false,
 "Values": {
   "validationFileNameTemplate": "validationconfig",
   "blobStorageHost": "http://remotehost.url/bfr/"
 },
 "Host": {
   "LocalHttpPort": 7072,
   "CORS": "*"
 }
}
  1. Run the following command to run the serverless api project locally. The project would re-run itself when there is any changes in .js files in validation-api directory
yarn install
func start

Build and Test

Testing

Run the following command to test the application based on specs specified in __test__ directory

yarn test # npm test 

To run tests in watch mode to changes in the spec files, run-

yarn test:watch # npm run test:watch

To check test coverage, run-

yarn test:coverage # npm run test:coverage

Production Build

Validation Engine

Run the following command to build as ES6+ module in dist directory.

yarn build # npm run build

Validation Azure Serverless Api

Run the following command to have the Azure Functions serverless api with latest version of the validation engine inside validation-api directory.

yarn build

Usage

The module can then be imported to Javascript frameworks or NodeJS applications as

ES6+

import ValidationEngine from './path-to-module'

ES5 with Webpack or CommonJS

const ValidationEngine = require('./path-to-module')

The module can be instantiated with validation configuration as below

const valEngine = new ValidationEngine(config)

Config Data Structure

{
  "VAL2260S": {
    "type": "SOFT",
    "logicRule": "001-Sum of main cells exceeds threshold",
    "mainCells": [
      "218-1"
    ],
    "threshold": 50,
    "warningFlag1": "Some warning data",
    "warningFlag2": "VAL2260S: Some additional warning data",
    "enabled": true
  }
}