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

@noodle-group/noodl

v1.0.11

Published

nooDL is a package for efficient validation of US driver license numbers across all 50 states and the District of Columbia.

Downloads

15

Readme

nooDL: US Driver License Number Validator 🪪

nooDL is a TypeScript-based Node.js package providing efficient validation of United States driver license numbers. It covers all 50 states and the District of Columbia.

Based on and updated in accordance with the formats provided by the NTSI.

npm version npm downloads GitHub Workflow Status GitHub last commit (branch) License

Features

  • Comprehensive Coverage: nooDL supports validation for driver license numbers from all 50 states and the District of Columbia.
  • Efficiency: The package uses Regular Expressions (RegEx) for quick and accurate validation.
  • Flexibility: Matches a variety of license formats as per each state's specifications.
  • Ease of Use: A simple API that requires just the state and the license number to validate.
  • TypeScript Support: Ensures type safety and provides autocompletion features in IDEs. Also compatible with CommonJS.
  • Thoroughly Tested: 100% coverage.

Installation

To install nooDL, run the following command in your terminal:

npm i @noodle-group/noodl

Usage

Here are some basic usage examples:

import { validateLicense } from '@noodle-group/noodl';

const result0 = validateLicense('NY', '12345678'); // Valid
console.log(result0); // Output: 'numeric-8-to-9'

const result1 = validateLicense('NY', '1234567890'); // Invalid
console.log(result1); // Output: null
import { matchLicense } from '@noodle-group/noodl';

const result = matchLicense('12345678');
console.log(result);
// Output:
// {
//   "AL": [
//       "numeric-1-to-8",
//   ],
//   "AR": [
//       "numeric-4-to-9",
//   ],
//   "GA": [
//       "numeric-7-to-9",
//   ],
//   "LA": [
//       "numeric-1-to-9",
//   ],
//   "ME": [
//       "numeric-8",
//   ],
//   "NC": [
//       "numeric-1-to-12",
//   ],
//   "NM": [
//       "numeric-8-to-9",
//   ],
//   "NY": [
//       "numeric-8-to-9",
//   ],
//   "OH": [
//       "numeric-8",
//   ],
//   "OR": [
//       "numeric-1-to-9",
//   ],
//   "PA": [
//       "numeric-8",
//   ],
//   "SC": [
//       "numeric-5-to-11",
//   ],
//   "SD": [
//       "numeric-6-to-10",
//   ],
//   "TN": [
//       "numeric-7-to-9",
//   ],
//   "TX": [
//       "numeric-7-to-8",
//   ],
//   "UT": [
//       "numeric-4-to-10",
//   ],
//   "VT": [
//       "numeric-8",
//   ],
// }

API

validateLicense(state: State, license: string): string | null

This function validates a license number for a specific state and returns the matched pattern name if the license number is valid. If the license number is invalid or the state is not supported, it returns null.

Parameters:

  • state: State - The state for which the license number should be validated.
  • license: string - The license number to be validated.

Returns:

  • string | null - The matched pattern name if the license number is valid for the given state, or null if the license number is invalid or the state is not supported.

matchLicense(license: string): MatchedStates

This function matches a license number against all supported states and returns an object containing the matched patterns for each state.

Parameters:

  • license: string - The license number to be matched.

Returns:

  • MatchedStates - An object containing the matched patterns for each state. The keys of the object represent the matched states, and the values are arrays of matched pattern names.

Changelog

  • 1.0.9: Initial release.

License

nooDL is licensed under the MIT license. See LICENSE.md for more details.

Sure, here is a paragraph you can include in your README.md file to guide people to the CONTRIBUTING.md:

Contributing

We welcome and appreciate all contributions from the community! If you're interested in contributing to noodle-group/nooDL, be it in the form of bug reports, feature suggestions, code contributions, or improvements to our documentation, please take a look at our Contribution Guide. It provides detailed instructions on how to get started with your contribution. No matter your level of experience, every contribution counts, and we look forward to collaborating with you!