{
  "name": "compilex",
  "version": "0.5.0",
  "description": "compilex is a node.js library which is used to build online code editor/compiler websites and webservices.",
  "main": "compilex.js",
  "dependencies": {
    "cuid": "~1.2.4",
    "colors": "~0.6.2"
  },
  "devDependencies": {},
  "scripts": {
    "test": "make test"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/scriptnull/compilex.git"
  },
  "keywords": [
    "compile",
    "compiler",
    "c",
    "c++",
    "compilex",
    "java",
    "python"
  ],
  "author": {
    "name": "Vishnu Bharathi",
    "email": "vishnubharathi04@gmail.com",
    "url": "https://twitter.com/scriptnull"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/scriptnull/compilex/issues"
  },
  "homepage": "https://github.com/scriptnull/compilex",
  "readme": "<h1>compilex</h1>\r\n[![NPM version](https://badge.fury.io/js/compilex.svg)](http://badge.fury.io/js/compilex)\r\n[![Build Status](https://travis-ci.org/scriptnull/compilex.svg?branch=master)](https://travis-ci.org/scriptnull/compilex)\r\n[![Dependency Status](https://david-dm.org/scriptnull/compilex.svg)](https://david-dm.org/scriptnull/compilex)\r\n[![Download Status](http://img.shields.io/npm/dm/compilex.svg)](https://www.npmjs.org/package/compilex)\r\n[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/scriptnull/compilex/blob/master/License.md)\r\n\r\n\r\ncompilex is a node.js library which is used to build online code editor/compiler websites and webservices.\r\n\r\nYou can compile and respond back outputs for all the languages that can be compiled by the server.\r\n\r\nSome of the online code compiling/judging websites are \r\n<ul>\r\n<li><a href=\"http://www.codepad.org\">codepad</a></li>\r\n<li><a href=\"http://www.ideone.com\">ideone</a></li>\r\n<li><a href=\"http://www.hackerrank.com\">HackerRank</a></li>\r\n<li><a href=\"http://www.codechef.com\">CodeChef</a></li>\r\n</ul>\r\nUsing compilex , you can built sites and services like the above said examples.\r\n\r\nWhy compilex ?\r\n=============\r\n1) It is the one and only library implmenting the online compiler concept. <br/>\r\n2) compilex can detect infinite loops in the users program . <br/>\r\n3) It can compile programs by getting input from STDIN and from command line arguments. <br/>\r\n4) Generates statistics for the administrator. <br />\r\n5) Will include more supporting functions in the future releases.\r\n\r\nSupported Languages \r\n===================\r\ncompilex is currently in initial development stage . As the library grows , so does the list here .\r\n\r\n| Language | Support |\r\n|---------|:-------:|\r\n|C |&#x2714;|\r\n|C++ | &#x2714; |\r\n|Java | &#x2714; |\r\n|Python | &#x2714; |\r\n|C# | Available Soon |\r\n|Visual Basic | Available Soon |\r\n|Ruby | Availlable Soon |\r\n|JavaScript | Available Soon |\r\n|PHP | Available Soon |\r\n|Perl | Available Soon |\r\n|Lua | Available Soon |\r\n|Haskell| Available Soon |\r\n|Other Languages | Available Later |\r\n\r\ncompilex roles out updates more frequently.Days are not so far , you can see the above languages soon.\r\n\r\nWork Flow\r\n=========\r\n1) Get the program as input from the client as a request<br/>\r\n2) Use compilex modules to compile the program <br/>\r\n3) Get the output and errors in json and string formats <br/>\r\n4) Respond the output to the client<br/>\r\n\r\nSetting Up Compilers \r\n====================\r\nInorder to compile any programming language , you need to first have the compiler for that programming language in the server machine.\r\n\r\n<h4>C and C++</h4>\r\n<ol>\r\n<li><b>Installation :</b>You need GCC compiler that can compile programs from your cmd/terminal\r\n    <ul>\r\n    <li>Windows - You can get <a href=\"http://www.mingw.org/\">MinGw</a> . </li>\r\n    <li>Linux - Most of the linux versions are installed with gcc by default. If you haven't got , Take a look at <a href=\"http://gcc.gnu.org/wiki/InstallingGCC\">Installing GCC</a> . </li>\r\n    </ul>\r\n</li>\r\n<li><b>Testing the Environment :</b>After installing , set your environment variables for accessing the GCC command lines from any directory\r\n    <ul>\r\n    <li>Windows - create a c file in a directory , execute <br/> \r\n    <i><b>g++ filename.c -o output.exe<br/>\r\n    output.exe</b></i><br/>\r\n    then you will get the output of the program</li>\r\n    <li>Linux - create a c file in a directory , execute <br/>\r\n    <i><b>gcc filename.c -o output.out<br/>\r\n    ./output.out</b></i><br />\r\n    then you will get the output of the program</li>\r\n    </ul>\r\n</ol>\r\n\r\n<h4>Java</h4>\r\n<ol>\r\n<li><b>Installion :</b> You need JDK ( Java Development Kit ) to compile Java programs.Click <a href=\"http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\"> here </a> to download JDK for various platforms.</li>\r\n<li><b>Testing the Environment :</b>After installing , set your environment variables for accessing the javac command lines from any directory\r\n<ul>\r\n<li>Create a Java file named Main.java with main function<br/>\r\n<i><b>javac Main.java <br />\r\njava Main </b></i><br/>\r\nthen you will get the output of the program.\r\n</li>\r\n</ul>\r\n</ol>\r\n\r\n<h4>Python</h4>\r\n<ol>\r\n<li><b>Installation :</b> You can get and install Python from <a href=\"https://www.python.org/download/\"> here </a></li>\r\n<li><b>Testing the Environment :</b>After installing , set your environment variables for accessing python command lines from any directory\r\n<ul>\r\n<li>Create a python file hello.py and execute <br/>\r\n<i><b>python hello.py</b></i><br/>\r\nthen you will get the output of the program.\r\n</li>\r\n</ul>\r\n</ol>\r\n\r\n\r\nDocumentation\r\n=============\r\n<h5>1)Require compilex </h5>\r\n```javascript\r\nvar compiler = require('compilex');\r\nvar options = {stats : true}; //prints stats on console \r\ncompiler.init(options);\r\n```\r\ninit() creates a folder named temp in your project directory which is used for storage purpose.\r\nBefore using other methods , make sure to call init() method.\r\n\r\n<h5>2)C and C++ </h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\" , cmd : \"g++\"}; // (uses g++ command to compile )\r\n    //else\r\n    var envData = { OS : \"linux\" , cmd : \"gcc\" }; // ( uses gcc command to compile )\r\n    compiler.compileCPP(envData , code , function (data) {\r\n        res.send(data);\r\n        //data.error = error message \r\n        //data.output = output value\r\n    });\r\n    \r\n    //res is the response object\r\n```\r\n\r\n<h5>3)C and C++ with inputs </h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\" , cmd : \"g++\"}; // (uses g++ command to compile )\r\n    //else\r\n    var envData = { OS : \"linux\" , cmd : \"gcc\" }; // ( uses gcc command to compile )\r\n    compiler.compileCPPWithInput(envData , code , input , function (data) {\r\n        res.send(data);\r\n    });\r\n```\r\n\r\n<h5>4)Java</h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\"}; \r\n    //else\r\n    var envData = { OS : \"linux\" }; // (Support for Linux in Next version)\r\n    compiler.compileJava( envData , code , function(data){\r\n        res.send(data);\r\n    });    \r\n```\r\n\r\n<h5>5)Java with inputs</h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\"}; \r\n    //else\r\n    var envData = { OS : \"linux\" }; // (Support for Linux in Next version)\r\n    compiler.compileJavaWithInput( envData , code , input ,  function(data){\r\n        res.send(data);\r\n    });\r\n```\r\n<h5>6)Python</h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\"}; \r\n    //else\r\n    var envData = { OS : \"linux\" }; \r\n    compiler.compilePython( envData , code , function(data){\r\n        res.send(data);\r\n    });    \r\n```\r\n\r\n<h5>7)Python with inputs</h5>\r\n```javascript\r\n    //if windows  \r\n    var envData = { OS : \"windows\"}; \r\n    //else\r\n    var envData = { OS : \"linux\" }; \r\n    compiler.compilePythonWithInput( envData , code , input ,  function(data){\r\n        res.send(data);        \r\n    });\r\n```\r\n\r\n\r\n\r\n<h5>8)Memory Management </h5>\r\nAll the temporary files ( source code and executables ) are created in your temp directory.\r\nflush and flushSync helps you to free the memory by deleting the temporary files.\r\n```javascript\r\n    compiler.flush(function(){\r\n    console.log('All temporary files flushed !'); \r\n    });\r\n```\r\nSynchronous version of flush\r\n```javascript\r\n    compiler.flushSync();\r\n```\r\n\r\n<h5>9)Statistical Data</h5>\r\nGetting statistics about your compilex server has been taken care.\r\nfullStat returns json data about your server.\r\n```javascript\r\n    compiler.fullStat(function(data){\r\n        res.send(data);\r\n    });\r\n```\r\n\r\nExamples\r\n========\r\nYou can find examples <a href=\"examples\">here</a>.The examples are downloaded everytime you download compilex via npm.\r\nyou can begin with editing CSS and publish your site in minutes.\r\nHere is the screenshot of the demo.\r\n<br />\r\n<br />\r\n![alt text](https://github.com/scriptnull/compileX/raw/master/DemoPicture.png \"Screenshot image.\")\r\n\r\nLicense\r\n=======\r\nAll the contents in this repository are released under the <a href=\"https://github.com/scriptnull/compilex/blob/master/License.md\">MIT License</a> .\r\n\r\n[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/scriptnull/)\r\n\r\n",
  "readmeFilename": "README.md",
  "_id": "compilex@0.5.0",
  "_from": "compilex@"
}
