Questions tagged as 'nodejs'

1
answer

Sort a JSON array

Previously, in this link I asked for help to make a kind of top of users sorted by their score, using a JSON file defined as let points = JSON.parse(fs.readFileSync('./points.json', 'utf8')); With the following format: { "242043489611...
asked by 22.12.2016 / 12:14
3
answers

How to configure Ubuntu 14.04.4 VPS for app in NodeJS?

My query is as follows: I have an app made on nodeJS and Express, use SocketIO to extract data in real time from Twitter. What is the procedure to pass my app to a VPS in such a way that when doing sudo reboot my app is run on the...
asked by 17.03.2016 / 03:13
1
answer

Because getChildNodes gives me an unexpected result

When I get the children of the root node (books) I should get the result 3 (book, title and author) and I get 9 when applying getchildnotes (); books.xml <?xml version="1.0" encoding="UTF-8"?> <Libros> <Libro publicado_en=...
asked by 23.11.2018 / 15:49
1
answer

Get the name of a promise - async

I understand that if you have a function you can get the name with the property name and if it is a class you can get the name prototype.name but as I get the name of a promise, the problem is as follows I have several functions ty...
asked by 12.12.2018 / 14:29
2
answers

Any alternative for req.files in NodeJS v0.12.5?

I need to upload a file CSV to later save it in the database, this with angularjs and nodejs , but due to project restrictions we are using NodeJS v0.12.5 and does not support req.files Do you know any alternative or w...
asked by 02.02.2016 / 18:29
2
answers

Get the labels of a JSON

I'm doing a API that receives a JSON and I need to get which tags are inside that JSON . This is an example of JSON : [{ "Notification": [{ "Channel": 4, "Type": 1, "Means": [{ "Number": 8888888...
asked by 11.09.2018 / 23:19
2
answers

Check if it exists before saving in moongodb and nodejs

I need to store an array in my MondoDB database. This I do without problems with the following code: My array of objects: [ { name: '1', type: 'float', value: 89.05, timestamp: 1535440000 }, { name: '10', type: 'float', value: 19.67, time...
asked by 05.09.2018 / 13:12
1
answer

I can not get a POST with express (NodeJS)

I started to develop a small cahtbot with IBM technology (Watson), I'm using NodeJS for the development part of the application. I am using Express as a routing framework, I have also divided the project into views, routes and the server. I foun...
asked by 28.08.2018 / 22:40
1
answer

Difference between ./ and ../ in require Node.js

I have a require ./../app and I do not understand what it means, since from what I understand ./ implies in the current directory and ../ a directory above, with which I do not understand what they mean together. Thanks!     
asked by 03.10.2018 / 22:26
1
answer

Decrypt Base64 Array in nodejs

Hi, I have an encrypted fix in base64 and when I decrypt it, it does it with characters that I would like to delete: const b64_to_utf8 = (str) => { return new Buffer(str, 'base64').toString('ascii') }...
asked by 20.08.2018 / 04:52