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

js-fixerr

v2.2.1

Published

Lightweight and fast validation library for javascript

Downloads

5

Readme

js-fixerr

Lightweight and fast validation library for javascript

Installation

    npm install js-fixerr --save

Usage

    var fixerr = require('js-fixerr');

js-fixerr Functions

  • min
  • max
  • isLength
  • isWhiteSpace
  • isSpecialChar
  • isAlphaNumeric
  • isMobile
  • isEmail
  • isDate
  • isTime
  • isVowel
  • isUrl
  • isVideoUrl
  • isRoman
  • isBoolean
  • isIPaddress
  • isLeapYear
  • isMacAddress
  • isEqual

min

Validate if the input is smaller then the min value

  fixerr.min('foobaar', 3) // return true
  fixerr.min('fooba12', 3) // return true
  fixerr.min(34563, 4) // return true
  fixerr.min(345, 4) // return false  
  fixerr.min('foo', 5) // return false  

max

Validate if the input is greater then the max value

  fixerr.max('foobaar', 6) // return true
  fixerr.max(12345, 6) // return true
  fixerr.max(12345, 3) // return false
  fixerr.max('foo', 2) // return false

isLength

Validate if the string lie between the given value

  fixerr.isLength('foobaar',{min:0, max:7}) // return true
  fixerr.isLength(123456, {min:0, max:7}) // return true
  fixerr.isLength(123456567878, {min:0, max:7}) // return flase
  fixerr.isLength('foobaar', {min:0, max:5}); // return false

isWhiteSpace

Validate if the input has whitespace

  fixerr.isWhiteSpace('foobaar') // return false
  fixerr.isWhiteSpace('a s') // return true
  fixerr.isWhiteSpace('') // return false
  fixerr.isWhiteSpace('foo baar'); // return true

isSpecialChar

Validate if the input has Special character

  fixerr.isSpecialChar('foo@$ba%ar') // return true
  fixerr.isSpecialChar('f!oo~ar') // return true   
  fixerr.isSpecialChar(' ') // return true
  fixerr.isSpecialChar('foobaar'); // return false
  

isAlphaNumeric

Validate if the input has no Alphanumeric characters

    fixerr.isAlphaNumeric('foobaar') // return false
    fixerr.isAlphaNumeric('fooba901') // return true

isMobile

Validate if the input is a 10 digit mobile number

    fixerr.isMobile(1234567890) // return true
    fixerr.isMobile(745387) // return false

isEmail

Validate if the input is a email address

    fixerr.isEmail('[email protected]') // return true
    fixerr.isEmail('jsfixerr@com') // return false
    fixerr.isEmail('jsfix err@ gmail com') // return false

isDate

Validate if the input is a date

  fixerr.date('10/12/2017', { format: 'MM/DD/YYYY' }) // return true
  fixerr.date('10-12-2017', { format: 'MM-DD-YYYY' }) // return true
  fixerr.date('2017-12-12', { format: 'YYYY-DD-MM' }) // return true
  fixerr.date('2017/01/08', { format: 'YYYY/DD/MM' }) // return true

isVowel

Validate if the input is a vowel

  fixerr.isVowel('a') // return true
  fixerr.isVowel('aeo') // return true  
  fixerr.isVowel('aeoiu') // return true  
  fixerr.isVowel('sdf') // return false
  fixerr.isVowel('sdfa') // return false
    

isVideoUrl

Validate if the input is a youtube video Url

  fixerr.isVideoUrl('https://www.youtube.com/watch?v=LyrqhruLhBA') // return true
  fixerr.isVideoUrl('https://www.youtube.com/watch?v=LyrqhruLhB') // return false  

isMacAddress

Validate if the input is a MAC Address

  fixerr.isMacAddress('FF:FF:FF:FF:FF:FF') // return true
  fixerr.isMacAddress('asman:asdas') // return false

isLeapYear

Validate if the input is a leap year

  fixerr.isLeapYear(2020) // return true
  fixerr.isLeapYear(2017) // return false

isIPaddress

Validate if the input is a Ip address

  fixerr.isIPaddress('192.168.0.1') // return true
  fixerr.isIPaddress('192.168.0.') // return false
    

isVowel

Validate if the input has a vowel

  fixerr.isVowel('asskdsdf') // return true
  fixerr.isVowel('zxcvbn') // return false
  

isBoolean

Validate if the input is a boolean value

  fixerr.isBoolean(true) // return true
  fixerr.isBoolean(false) // return true  
  fixerr.isBoolean(1) // return false

isRoman

Validate if the input is Roman

    fixerr.isRoman('IV') // return true
    fixerr.isRoman('iv') // return true
    fixerr.isRoman('ER') // return false

isEqual

*Comparing two values

    fixerr.isEqual('sam','nam'); // return false
    fixerr.isEqual('sam','sam'); // return true

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Contribution

Feel free to contribute