Mr.Node is very fast and also very easy to use. Simple, self-explanatory functions get the code to work like it should. He is very smart... ヾ(⌐■_■)ノ
$ npm install --save-dev mrnode
$ bower install --save-dev mrnode
<script src="https://unpkg.com/[email protected]"></script>
These functions practically explain themselves.
//Functions //Creating files create('filename', 'fileextension'); //Minify JS and CSS //use the gulp-uglify in the terminal minifyjs(); minifycss();
require attribute. Do this in a file called
mrnode.js. Create this file in the root of your directory.
var mrnode = require('mrnode');
After you have done that, you are all set! Right after you have typed in one of Mr.Node's functions, type this into your terminal:
$ node mrnode.js. Note: To do this you must be in the directory of your project. If you don't know how to do that, here you go:
$ cd \Users\youruser\yourdirectory.
This takes the dependent of "fs"(filesystem). This is a node module. The dependencies are already listed in the package.JSON.
//Functions mrnode.create('filename', 'fileextension');
For creating files you are now able to choose a file extension. You type in the file name as the first parameter and the file extension as the second parameter.
Use these functions to minify certain files
//Minify JS and CSS //use the gulp-uglify in the terminal mrnode.minifyjs('yourfolder/yourfile','yourdestination'); mrnode.minifycss('yourfolder/yourfile','yourdestinationfolder');
minifyjs();, use in the terminal:
$ gulp uglify. For
minifycss();, use in the terminal:
$ gulp minify.
//Functions mrnode.delete('yourfolder/yourfile', 'yourdestination');
Before this, you type 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.
This shows you how to beautify files.
//Functions mrnode.beautify('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.
//Functions mrnode.csass('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.
This will show you how to rename your files.
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.
Creating a Server
Creating a Node.js server can be pretty difficult for some people. So Mr.Node gives you a very simple function to create a server.
The only thing that Mr.Node requires you to do in this function is type in the port that you would like your server to be hosted on. The port mush be 4 numbers, such as:
3000. Type in to your terminal:
$ node mrnode.js. Now go to http://localhost:yourport. Your server should be running!
This will take you through how to transpile es6 to es5.
All that you have to do is type in the file that you want to transpile. Then just select a destination of where you want the file to go when it is done transpiling.