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

regular-expression-validation

v1.0.1

Published

Regular expressions wrapped in functions for basic validation - in client and the server.

Downloads

8

Readme

Regular Expressions for JavaScript

Made for the purpose of validating strings and arrays with regular expressions.

This package exposes API's through /lib. So far you can:

Validate a single email

import {
  EmailValidation,
  EmailExp,
} from 'regular-expression-validation/lib/EmailRegExp';

EmailValidation(EmailExp, '[email protected]');

Validate an array of emails

import {
  EmailArrayValidation,
  EmailExp,
} from 'regular-expression-validation/lib/EmailArrayRegExp';
import { EmailArray } from 'regular-expression-validation/lib/EmailArray';

const myEmailArray = EmailArray;

EmailArrayValidation(EmailExp, myEmailArray);

An array of emails for testing

import { EmailArray } from 'regular-expression-validation/lib/EmailArray';

console.info(`An array of emails:\n${EmailArray}`);

Getting Started with development

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

VS Code is a must-have for this project

Some extentions for VS Code are needed to fully utilise the config files.

  • Prettier
  • Eslint
  • Stylelint

Install them from the 'Extensions' tab or use the code quick open (CTRL+P) and run these commands:

ext install esbenp.prettier-vscode
ext install shinnn.stylelint
ext install dbaeumer.vscode-eslint

The above list will get updated and separated into a needed and a practical extensions lists. For now, my entire settings file - including styling - is in the .vscode folder and would give an idea on what extensions to install if anything doesn't seem right.

This project is developed in TypeScript, make sure your environment supports this.

Installing

A step by step series of examples that tell you have to do to get a development env running

This codebase is managed with yarn, npm can be used but is not tested.

Clone the repo:

git clone [email protected]:MathiasKandelborg/Regular-Expressions.git

With HTTPS:

git clone https://github.com/MathiasKandelborg/Regular-Expressions.git

Go into the directory and install dependencies:

cd ./Regular-Expressions
yarn

You might have to re-compile the ts files to avoid errors:

tsc

End with an example of getting some data out of the system or using it for a little demo

Run the development server, localhost:1234 becomes available with HmR

yarn start

To run the storybook for the visual part of validation:

  • Note that the typings dir have to exist before running yarn storybook, otherwise the imports from the compiled output files will be wrong
yarn storybook

Running the tests

There aren't any tests yet. I'm not sure if any ever will be made.

This is a project made for playing with TS and i don't see much reason in adding tests when the project is so small. If the project grows a bit more, some tests will be added along with some kind of CI to go with it.

Coding style tests

These will be added with next release version, as package.json script commands.

Deployment

Well, this package doesn't belong on a webser on its own, does it?😉

That being said, this part will be updated with instructions on running the storybook build command and on how to publish this code as a npm module. If the project grows i might add gh-pages, Heroku or something like that.

Built With

  • TypeScript - Programming language (superset of JS) + build tool
  • Prettier - Code formatter
  • Yarn - Dependency Management
  • Storybook - Used to create interactive 'stories' based on code.
  • Parcel - Development server and possible build tool

Contributing

There's not a custom file yet, until then;

Please read the boilerplate CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

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

Generally, i won't do anything if you use my code. I do strongly recommend to test it thoroughly if you're going to use it in production.

Acknowledgments

  • PurpleBooth - README.md and CONTRIBUTIONS.md templates
  • Kriasoft and all the people at RSK - I learned a lot about configuration from using this repo. My config files mostly look like theirs because of all the practices I've taken with me.