Observed since 20 Oct, 21:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@00sukhjeet00/compilerjs
Code Compiling library
CompilerJs is Node JS library use to compile code for programming languages like C/C++, Java, Python.
In order to compile any programming language , you need to first have the compiler for that programming language in the server machine.
import { init } from '@00sukhjeet00/compilerjs';
init();
init() creates a folder named code in your project directory which is used for storage purpose.
Before using other methods , make sure to call init() method.
//Implementation for windows
const envData = { ext : "g++",options:{timeout:5000}} // (uses g++ command to compile )
//Implementation for Linux and Mac OS(Timeout functionlity is not implemented)
const envData = { ext : "gcc", options:{timeout:5000} } // ( uses gcc command to compile )
compileCPP(envData , code ,(data)=> {
console.log(data)
//data.error = error message
//data.output = output value
})
//Implementation for windows Linux and Mac OS(Timeout functionlity is not implemented)
const envData = { ext : "g++",options:{timeout:5000}} // (uses g++ command to compile )
//Implementation for Linux and Mac OS(Timeout functionlity is not implemented)
const envData = { ext : "gcc" ,options:{timeout:5000}}; // ( uses gcc command to compile )
compileCPPWithInput(envData , code , input , (data)=> {
console.log(data);
});
var envData = { ext:"java" ,options:{timeout:5000} };
compileJava( envData , code ,(data)=>{
console.log(data);
});
const envData = { ext:"java" ,options:{timeout:5000} };
compilerJs.compileJavaWithInput( envData , code , input ,(data)=>{
console.log(data);
});
const envData = { ext:"py" ,options:{timeout:5000} };
compilePython( envData , code ,(data)=>{
console.log(data);
});
const envData = { ext:"py" options: {timeout:5000} };
compilePythonWithInput( envData , code , input ,(data)=>{
console.log(data);
});
Timeout help to run program for particular time (in ms). It support window and linux system. Timeout can be used similarly in C/C++, Java, Python as showen below.
const envData={ ext: "py", options: {timeout:5000} } // timeout: 5 running program for 5 sec.
import { init, compilePy } from '@00sukhjeet00/compilerjs'
init()
const envData = { ext: 'py', options: { timeout: 1000 } }
const code=`print('hello')`
compilePy(envData, code, (data) => {
if (data.error)
console.log(data.error)
else
{
if (data.timeout)
console.log('TLE')
else
console.log(data.out)
}
})
Similar code structure for other languages
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
cuidEnvironment{
"local_name": "cuid",
"alias": false,
"peer_metadata": null
} | ^2.1.8 | runtime |
Source distribution
{
"shasum": "67cb85a8fdf9876024d3f9aa5c410658f436a98d",
"tarball": "https://registry.npmjs.org/@00sukhjeet00/compilerjs/-/compilerjs-1.5.3.tgz",
"fileCount": 7,
"integrity": "sha512-pAfDNFHwX7O7j0F2sUAS9LLIh8jC/Vxyb1xSCvn5Dftwe8InQp/NXxH2WC0ZnA0dDj6CGVt7CmiZrbltw/RyQg==",
"signatures": [
{
"sig": "MEQCIALUEi29SAxIrbTv4aFri7c5jqb4queddWCPL+l2u3RmAiBW76xURVM37D9F00LBYOzDgPYfnatiP+bukzXfIX4otg==",
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
}
],
"unpackedSize": 26624,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSky6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+Fw/9GUjIqNexGiS4Q1K+znInmi3Kdo6JLQU+jf5ti5B/WEk2X2Y1\r\ntS7HCuTsSd8rUoGIosWS4bJ07r9HiSO/21UKJi9fWqnyGyNM3tus8caNhyjY\r\nLBe8NIX1qUgj8wp3nUgWAexQ8w93VQJA5qFGQU32/3lvtYoyIzphdH8QGitp\r\niTOxzFvauGZ6qRudFAE83gduN2wceT28EyBJ3E6muoT5F55Nm818wOaRLav1\r\nJrmxPv3gqLcK1A23rPQvQVv9am00kWpvAjf26yg92AKSo0+iPr1nDTtJs/t5\r\nxS26ytYq4yI0Gsb+gX3tj1NRJYFEWmgBxW0KqFSAfIRaxp80WehJ+gFDcxhU\r\nbjTKvXIKlX97xh+5Gro4FbkwYBxoDFQirw72QokfKqNX98baE8oyB1EMAZW9\r\ncJA/bd5Wp5jm5PW8z6XUeRAiVokH7PEvcK/zZeR6YbUFb8yuzvirEKftpI5G\r\n9Ckkr2y3a1E2Cue3LolY2FEMAspmhUmPfpFlyEqRi6rtyfQzyBAY61/A4EHf\r\ncGASffQaBoepgNBIP71NFLBplc+XmIgU/mWdVy6UYZyChyfgarZhkYOwsvJT\r\nkmOTSFqHAsgO1CSVvu3Zyg4QYrJ9y1cFnRmPkBeS63GliQtWaKFWEgtBnhKw\r\n2mGf1PBCbUTq52goUzTj8tT9vtCB6/ybeuM=\r\n=7qE6\r\n-----END PGP SIGNATURE-----\r\n"
}Observed since 20 Oct, 21:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:96c4346bdd436e5965b32ef0f2bb2c81ab2df28afecc18fdbaf582e18c2b337f