UNPKG

upc-check-digits-reddit

Version:

A scanner that can determine if a given (UPC-A) code is a valid bar code.

44 lines (25 loc) 1.28 kB
# To know ! This dependency was created just for fun and should NOT be in a production environment. It was purely created for me willing to go through the whole process of creating a library. The implementation of the code was a simple challenge took from reddit, and it's probably bad. For more details, check the acknowledgments bellow. ## Getting Started ``` npm i upc-check-digits-reddit ``` ### Importing ``` let upcCheck = require('upc-check-digits-reddit') ``` ### How to use it ? Pretty straightforward : ``` if(upcCheck("042100005264")) console.log("It's a valid code !") ``` ## Contributing To contribute, please submit problems in the [Issues](https://github.com/MasMedIm/UPC-check-digits/issues) tab, or give better implementations with a direct [Pull request](https://github.com/MasMedIm/UPC-check-digits/pulls) ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details ## Acknowledgments * Please visite [r/dailyprogrammer](https://www.reddit.com/r/dailyprogrammer/comments/a72sdj/20181217_challenge_370_easy_upc_check_digits/) for better implementations * This dependency was created just for fun and should NOT be in a production environment * Ty