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

jovial

v0.0.27

Published

Javascript Object Validation Interception Augmentation Library

Downloads

86

Readme

JOVIAL

JavaScript Object Validation Interception Augmentation Library.

Build Status Codacy Badge Code Climate Test Coverage Issue Count

NPM

A light weight, easily extensible validation mechanism for JavaScript objects that supports both batch and real-time per property validation.

You can see an intro to JOVIAL at http://anywhichway.github.io/.

Here is an example Validator:

new Validator({name: {type: 'string', length: 25, required: true}, 
                  age: {type: 'number', min:0, max: 110},
                  gender: {in: ['male','female']},
                  ssn: {type: 'SSN'},
                  location: {type: 'latlon'}})

Also supported are RegExp matching, soundex testing, range testing, developer supplied functions.

Install

npm install jovial

The index.js and package.json files are compatible with https://github.com/anywhichway/node-require so that jovial can be served directly to the browser from the node-modules/jovial directory when using node Express.

Browser code can also be found in the browser directory at https://github.com/anywhichway/jovial.

Documentation

See the GitHub Wiki: https://github.com/anywhichway/jovial/wiki/

Building & Testing

Building & testing is conducted using Travis, Mocha, Chai, and Istanbul.

Notes

Due to an unavoidable shortcoming in chrome-proxy, the unit test for testing the prevention of deleting required properties fails. All tests should pass in Edge and Firefox.

Updates (reverse chronological order)

2016-05-28 v0.0.27 Added second argument to constructor to have validate call limit properties to those in the validate schema if set to true. Like most methods, modified code to ensure .validate method is not enumerable.

2016-04-28 v0.0.26 Eliminated chrome-proxy since NodeJS v6.0 supports Proxy now. Also fixed errors uncovered as a result where set handlers were not returning true in Proxy.

2016-03-03-14 v0.0.25 internals complexity reduction and README update, no functional changes

2016-03-03-04 v0.0.24 credit card validation modified from RegExp to Luhn algorithm, ability to enhance types using functions added.

2016-02-04 v0.0.23 ISBN, credit card (CC), IP address (IP). Moved most documentatin to GitHUb wiki (https://github.com/anywhichway/jovial/wiki) so it will be easier to upgrade without pushing new NPM packages.

2016-01-28 v0.0.22 Added default values and write once support. Fixed bug with dot notation in subtypes (they did not work). Added the unit test!

2016-01-27 v0.0.21 Added email validation and made type checking extensible.

2016-01-23 v0.0.20 Attempting to fix Markdown issues on npmjs.org that do not manifest on GitHub. No code changes. Sure wish there was a way to push a new README to npmjs.org without a version increment!

2016-01-23 v0.0.19 Corrected length check on Set when value is actually unknown. Clarified the meaning of unknown in the documentation.

2016-01-23 v0.0.18 Modified type checking to ignore unknown values.

2016-01-23 v0.0.17 Addressed issue where Proxy sometimes did not get loaded and lifted to global scope by Browserify.

2016-01-23 v0.0.16 Cleaned-up Proxy bundling for Chrome. Corrected documentation regarding structure of ValidationError. Add non-null test for length validation.

2016-01-22 v0.0.15 Added .echoes, .satisfies and .validate and latlon type. Corrected bug where .type did not work as documented with functions. Added more unit tests. Updated documentation.

2016-01-21 v0.0.14 Updated dependency on chrome-proxy to > 0.0.8.

2016-01-21 v0.0.13 Reworked module closure wrapper so it would work regardless of whether browserify is used.

2016-01-18 v0.0.12 Corrected issue where underlying values did not get set after validation. Added more unit tests. Added .length, .in, .transform. Added support for property delete and define.

2016-01-13 v0.0.11 Added browserified and minified version.

2015-12-13 v0.0.10 Corrected README format

2015-12-13 v0.0.9 Added more unit tests and documentation

2015-12-13 v0.0.8 Added unit tests and missing error handlers for min, max, matches

2015-12-12 v0.0.7 Codacy driven improvements

2015-11-29 v0.0.6 Original public commit

License

This software is provided as-is under the MIT license.