Socket
Book a DemoInstallSign in
Socket

js2cp

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js2cp

A Javascript to C++ "Translator", built from Node.js!

2.0.2
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

JS2CP

A Javascript to C++ "Translator", built from Node.js!

Installation

Local install

npm install js2cp

Usage

Local usage

const js2cp = require("js2cp")
js2cp.translate("Path to js program") //js2cp.translate("test.js")

Examples

Let's assume u have your extra powerful hello world program.

helloWorld.js

With insane "Hello World!" code inside

console.log("Hello World!")

How to translate

    const js2cp = require("js2cp")
    js2cp.translate("./helloWorld.js")

This will create a new file.In our case helloWorld.cpp

./helloWorld.cpp

#include <iostream>

int main(){

std::cout <<"Hello World!"<< std::endl;

// If you want to pause the program at the end just uncomment line below
// system("pause>0")
};

Info

Translator does not support the "frontend technologies", like document.querySelector etc. So please, don't even try it, it will compile with bugs.

JS2CP is build for "competetive programming" applications. That means, with logic of complexity in js functions.

JS2CP is still under development, so use it wisely.

PSS: If you have any questions or complaints, please open issue on the GitHub https://github.com/borecjeborec1/

FAQs

Package last updated on 28 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.