Randomize variable names each time UglifyJS runs

If you are using UglifyJS to uglify your JavaScript code, you are using it only to serve a single purpose – to make it hard for anyone to peek into your code. But if you have minor changes to the code, variable names still come out pretty much same. It is extremely easy for someone… Read More »

How to use JSDoc @event tag correctly?

I am using JSDoc 3.4.2 for my Javascript API documentation need. By looking at the @event tag example, when I tried to use it, the event name was replaced with “event:” + event name which was a sign that it was looking at the @event tag correctly but found two issues. When I use @fire… Read More »

JSDoc Tokenizer plugin to replace the token with values from config

If you are a Javascript developer, you would have used the JSDoc to document your Javascript code. I was trying to use the JSDoc for generating the documentation for my PramukhIME Javascript library. I have the core library and based on the plugin, I wanted to generate the documentation to show how the plugin works… Read More »

JSDoc – Customize output documentation files

I am using JSDoc 3.4.2 for my Javascript library documentation. I wanted to make the change to the output files so here are the tricks I used to make following changes. In order to make the change, I have copied all the files from the default template available at “C:\Users\USERNAME\AppData\Roaming\npm\node_modules\jsdoc\templates\default” (JSDoc over Node.js location) to… Read More »

How to use plain old JavaScript file into Node.js as a module

If you want to use your plain old JavaScript file into Node.js, you need to create a module which is nothing but a fancy wrapper around your JavaScript file and then you can use all the functions of your JavaScript object into Node.js. Environment Windows 7 (64 bit) Node.js 4.4.2 (64 bit) Path already contains… Read More »

Crash FreeTextBox using Javascript

Would you like to crash FreeTextBox? Here is the trick. Visit the page http://freetextbox.com/demos/Default.aspx Click on HTML view and copy/paste the following code. <script language="javascript">alert("Hi");</script> Hello Press “Save” button. This will convert your code into <script language="javascript"> <![CDATA[lert("Hi");]]> </script> Hello Note that “a” is missing. Pretty interesting!!! hmmmmmm…. Now again click on HTML view and… Read More »

Be Careful When You Are Using Javascript parseInt() Function

First of all guess the result and then get the actual answer by clicking on the button “Show Result” parseInt("04")=?; parseInt("08")=?; In Javascript if the string starts with “0”, the string will be parsed as if it is octal number. (i.e. base 8) instead of decimal number(i.e. base 10). So if you are parsing the… Read More »