Why Use?
Mr.Node is very fast and also very easy to use. You just have to type in a single function to get the code to work. He is very smart.
Documentation
Npm install:
npm install --save-dev mrnode
Bower install:
bower install --save-dev mrnode
CDN:
<scriptsrc="https://unpkg.com/mrnode@0.0.7/dist/js/main.min.js"></script>
Usage
The functions practically explain themselves.
//Functions//Creating filescreatejs();createcss();createhtml();createminjs();createmincss();//Minify JS and CSS//use the gulp-uglify in the terminalminifyjs();minifycss();
Creating Files
This takes the dependent of "fs"(filesystem). This is a node module. The dependencies are already listed in the package.JSON.
//Functionscreatejs();createcss();createhtml();createminjs();createmincss();
This simply creates a file, maybe a file such as Javscript. That would be: createjs();
. Or maybe you wanted to make a javascript file with the min extension. That would be this: createminjs();
.
Minifying Files
Use these functions to minify certain files
//Minify JS and CSS//use the gulp-uglify in the terminalminifyjs('yourfolder/yourfile','yourdestination');minifycss('yourfolder/yourfile','yourdestinationfolder');
For minifyjs();
, use in the terminal: $ gulp uglify
. For minifycss();
, use in the terminal: $ gulp minify
.
Deleting Javascript Files
You use this to delete a javascript file.
//Functionsdelete('yourfolder/yourfile', 'yourdestination');
Fore this, you typer in your file that you want to delete as the first parameter. Then you type in your destination folder so that the program knows where the code should end up.
Beautify
This shows you how to beautify files.
//Functionsbeautify('yourfolder/yourfile', 'yourdestinationfolder');
For this function, you choose which file to beautify by typing your file directory into the parameters for the function. Then type in your destination folder so that the program knows where the files should end up.
Convert Sass to CSS
This shows you how to convert Sass to CSS with Mr.Node.
//Functionscsass('yourfolder/yourfile', 'yourdestinationfolder');
For this you want to type in your own file into the function parameter area, then go to your terminal and type this: gulp sass
. This new css file will be in your destination folder.
Renaming Files
This will show you how to rename your files.
//Functionsrenameit('yourfolder/yourfile,'newname','yourdestinationfolder');
First you want to type in the first parameter of what file you want to rename. Then type in the new name in the second parameter. Then all you need to do is type in the destination folder you want your renamed file to go to, in the third parameter.