Questions tagged [node-api]

26 questions
0
votes
0 answers

node-gyp c++ chrome extension

i need to create chrome extension that can call c++ from js so i use nodeapi and to achieve that I used the node-gyp package.json { "name": "test", "version": "0.13.0", "description": "test", "main": "./index.js", "files": [ …
0
votes
0 answers

Node-API napi_make_callback behaviour with async JS function handlers

In my application, I am using Node-API, napi_make_callback to invoke a javascript function which returns some key connecting to different server. The javascript callback function shall perform an socket I/O to get the result from server. How does…
0
votes
1 answer

Need to get data from fixture JSON

I am struggling hard since yesterday getting the data from JSON, I don't understand why the fixture is not accessible. When I tried to get the ID, it gives me an error saying id isn't defined. This gives me an error saying ID is not…
user16870886
0
votes
1 answer

How to convert a std::string containing bytes encoded in windows-1252 to a string containing utf8 encoded data?

Using modern C++ and the std library, what is the easiest and cleanest way to convert a std::string containing windows-1252 encoded characters to utf-8? My use case is I'm parsing a CSV files which is windows-1252 encoded, and then push some of its…
Victor
  • 133
  • 7
0
votes
1 answer

Electron cannot execute c++ library (libpcap) through node_api

I am trying to use pcap(libpcap library in Linux) in Electron through NodeJS's node_api. The key code block in C++ is followed. static napi_value RunCallback(napi_env env, const napi_callback_info info) { char errBuf[PCAP_ERRBUF_SIZE]; …
PPLong
  • 1
0
votes
0 answers

Parallel Processing in Node-RED

This is a question related to Node-RED, but I'm asking here because I couldn't find an answer in the Node-RED forum. Maybe someone here can help me out. I am importing a C++ addon into my Node-RED to send samples from my Analog Discovery 2 device…
mohamadj
  • 1
  • 1
0
votes
2 answers

I have Created a Whatsapp Clone using MERN Stack. Facing Errors in backEnd side

I have created a WhatsApp clone in the backend of Whatsapp clone i am facing following errors. when i run yarn start i am facing following errors in console. yarn start yarn run v1.23.0-20200615.1913 $ node server.js (node:4316)…
0
votes
0 answers

need a better and efficient way

exports.Country = async (req, res, err) => { MongoClient.connect(url, function (err, db) { if (err) send.json({ message: err.message, statuscode: err.status }); var dbo = db.db(DATABASE); …
0
votes
0 answers

node js api design and waiting for long process excution

I have 2 tables pin codes - list of pin codes [lets take 5000] addresses - corresponding addresses-from an API I want to write an API like '/update-addresses' by using Node Js After updating the required table API should give response back like…
0
votes
1 answer

How to get a JavaScript number as a string using Node-API

I'm building a Node.js addon using Node-API. The logic has been simplified as below, Use pass js array into the addon and get some filtered array as the output. Inside the addon, the algorithm will skip any empty strings and false values. Below is…
0xdw
  • 3,755
  • 2
  • 25
  • 40
-1
votes
1 answer

Using axios / fetch to fetch data from node toreact

Please I need a help on how to fetch a data from node to react, I have been stuck here for 2 weeks now. Here are my backend code: server.js: require("dotenv").config(); const app = require("./src/app"); const port = process.env.PORT ||…
Eze
  • 3
  • 2
1
2