Node.js Project to Validate Youtube Video URL and ID Using youtube-validator Library in Javascript Full Tutorial For Beginners


Welcome folks today in this blog post we will be validating youtube video url using youtube-validator library in javascript. All the full source code of application is shown below.




Get Started




In order to get started we need to install youtube-validator` library using the npm command


npm i youtube-validator


After installing this library just create an index.js file and copy paste the following code






As you can see that the youtube video url is incorrect if we execute this node.js script you will see following error which is shown below




If you correct your url like as shown below




Now if you execute this node.js script it will be valid as shown below




Now we will be validating video id inside this application. Now copy paste the following code as shown below




Leave a Reply