Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications.

learn more… | top users | synonyms (2)

3
votes
0answers
10 views

Electron Application with JavaScript Backdoor and Ruby Command-Line Listener

I have created an Electron Application with a JavaScript/NodeJS Backdoor and a Ruby command-line listener. I created this program for remote administration of my home computer securely using a new ...
0
votes
0answers
14 views

Infrequently updated object caching

Based on the comments received I have moved this question to stackoverflow. I'm working on a project where I need to cache objects from the database that are infrequently updated. How is this as ...
0
votes
0answers
13 views

Directory listing in Node.JS

This solution works, and I like having all the logic after the return. The main purpose of this function was for use with other functions to return a file list: ...
1
vote
0answers
26 views
0
votes
0answers
9 views

Handling callbacks and errors Nodejs

I wrote a script for reading a csv, parsing it and saving data to mongodb. I would love some input on how I'm handling errors and dealing with callbacks. I wrote it with nested without using async and ...
1
vote
1answer
13 views

Optionally creating a directory path based based on existence in NodeJS

I've been doing some reading and tutorials. As such I've contrived a node based project to apply what I've learned. I thought this was a good example as it had some conditional async calls and error ...
1
vote
0answers
12 views

es6 OOP class Email + Facebook login

I've been given the task to create a micro-service which basically logs in OR creates a user. I chose to do this with express.js ...
1
vote
1answer
33 views

Support multi functionality in server.js

i've node app that having the main function server.js(entry point) Following is the server.js file code ...
1
vote
0answers
39 views

Dynamically call a function in a given module

I use the following code that is working as expected and I want to get some feedback from the community how I can Improve it... The code does the following: Get Some request with specific ...
2
votes
0answers
12 views

Wrapping a node.js module

I need to use elasticseach in my node.js project, whose API looks like the following: ...
0
votes
0answers
16 views

Merging JSON objects

I have 2 JSON structures. Input: ...
0
votes
0answers
6 views

Expressjs display specific error messages on signup

I'm using Node + Express + Mongo, my user Schema has three required fields: username email password I already took care of how the password is handled, but when it comes to username and email, ...
-2
votes
1answer
38 views

How to remove the boilerplate Promise code from ES6 and “co” code to write code without callback

I was trying to use the ES6 Promise with "co" module to write the async code without callback. Though actual async call is neat and clean however still I have to add wrapper method to return "Promise" ...
3
votes
2answers
65 views

calloc, malloc, free and realloc wrappers to store the size being allocated

I'm currently building a node.js addon for libcurl. Right now I'm trying to correctly use v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory to ...
1
vote
0answers
21 views

Getting data from service and storing it in MongoDB

I wrote code to get data from HTTP service and store it in MongoDB. Please, can someone let me know how efficient my code is and whether it is good from the OOP point of view? ...
1
vote
1answer
70 views

Callback/Promises implementation for a boolean check

Currently I have the following callback system: ...
4
votes
0answers
45 views

Passport user authentication

I'm using Passport in Node.js app to authenticate user by email and password (login) and also by token. Email and password are used only when user is logging in. Passport local strategy generates ...
4
votes
2answers
74 views

Generating Norwegian social security numbers

I have written some code in Node.js that takes a date as argument and return all the possible combination of social security numbers. I'd really appreciate some ...
2
votes
0answers
26 views

socket.io and garbage collection

I have developed a realtime text web app using socket.io that continuously displays text on the web page. When I run my code below with multiple clients connecting the memory usage for the V8 ...
0
votes
0answers
22 views

Function that creates an object graph from database rows

Using a low-level database driver called mysql, I run a query against the database: ...
2
votes
2answers
47 views
0
votes
1answer
24 views
1
vote
0answers
11 views

MongoDB Per-Module Reusable DB Object With Reconnection Handled

This implementation was derived from the following requirements. I would like to learn that whether the implementation is clean enough, without memory leak and performance hit. Requirements Always ...
0
votes
3answers
104 views

Multilingual greeter object

After coming across Douglas Crockford's views on class-free OOP, and doing away with new and this in Javascript I tried defining an object with its own variable and function, and returning it in JSON, ...
1
vote
2answers
41 views

Silly redis implementation

This is a silly Redis implementation that handles only three commands: INFO, ECHO, PING. The implementation is based on streams: ...
1
vote
1answer
27 views

Node module to fetch/post API data

I'm fairly new to JavaScript and Node and am wondering if I'm on the right track. Module file: ...
0
votes
0answers
10 views

Filter for user then grab object out of array

I have an Angular + socket.io app that sends a message to a specific user when a button is clicked. So I have a repeater of user in users then a ng-...
2
votes
1answer
114 views
2
votes
0answers
27 views

Node.JS HTTP shortcut wrapper

The Node.JS HTTP and HTTPS modules only provide .get shortcut function, unlike AngularJS's $http which provides them all. I went ...
1
vote
0answers
27 views

NodeJS Configuration Exporter

I have created a NodeJS script that I will be using to export front-end configuration details from my Zabbix installation, which will then be sent to my secondary (backup) Zabbix installation to keep ...
0
votes
2answers
20 views

Nested values copies from one object to another

Here is a nodejs code that copies values from one object (submitted from a firm) to a model object. Model: ...
1
vote
1answer
95 views

Unit tests for an Express middleware function that does basic authentication

I have written an Express middleware function called authenticateRequest that looks at the Authorization header of an incoming ...
11
votes
1answer
235 views

Make a summary from a larger text-file

This code makes summaries from larger texts. I have searched around for an algorithm and found the following: Associate words with their grammatical counterparts. (e.g. "city" and "cities") ...
2
votes
0answers
22 views

elastic search index/mapping creation

Including the full module, but the method I'm interested in is createIndex, feels more complicated than I think it should be. Still new at both node and elasticsearch ...
2
votes
1answer
40 views

NodeJS static file HTTP server

I wrote a NodeJS HTTP server specifically for serving static files. I didn't bother much about security since the server is going to be used locally in my Electron application. ...
2
votes
0answers
43 views

Signing timestamped API queries

The following code should prove to offer sufficient security for public API so my main concern is about design flaws in process. It is meant to describe the process and eventually get included in ...
2
votes
0answers
30 views

Nodejs-Compass,PID,Motors-with johnny-five

I just finish coding this code which use for control robot using compass sensor with PID control to control motors. Trying to make javascript object for necessary job. Please guide me for a better ...
4
votes
0answers
84 views

Restructure of Express CORS middleware for unit test

How should one break this component down to better perform unit test on its behaviors? Issues: Authentication middleware component makes external request. Must recognize preflight and final ...
0
votes
0answers
35 views

Simple channel broadcaster via NodeJS websockets

I have a system in PHP and I was asked to add some real time features. I was wanting to learn NodeJS so I considered a opportunity to kill two birds with one stone. But after some search I was unable ...
2
votes
0answers
37 views

Node my Chatter

In an effort to teach myself Node.JS and truly delve into its communication capabilities, I elected to recreate a previous chatting project. It took a bit of forethought to acclimate code to the ...
1
vote
0answers
32 views

Recursion into git diff tree using nodegit

I'm using nodegit to develop the backend for a nodejs app that uses a mix of mongodb and git for persistence. The app has to version documents and be able to present diffs between versions, thus the ...
6
votes
0answers
74 views

Node.js parallel file download, the ES6 way

I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to ...
0
votes
0answers
35 views

Web-scraping library

Here are two functions that make a request for a given URL and then takes the response body (HTML) and loads it into the cheerio library: scrapeListing.js ...
0
votes
0answers
55 views

Convert JSON into Avro acceptable format

I've written a node.js command line script that takes a multi-line file of JSON and a schema template of what the object should look like, and converts it to a format that Apache Avro accepts. ...
0
votes
1answer
46 views

Spawning child processes and event-listening

This function scrapes data from a webpage by spawning a process that executes a CasperJS web scraping script. The spawned process outputs data to stdout. This ...
0
votes
0answers
16 views

Alphanumerica binary search in node.js

I have some rather large arrays with hash values in them that looks like this: ZjFhOTZjYzgtMmZhMy00YjdkLThmMDgtNjI4MjYxNTc3MGRlXw==ntyxntmzmzkw I've done a binary search, using the node.js ...
1
vote
1answer
41 views

Iterations with asynchronous functions

I haven't really worked much with asynchronous code so I'm wondering if I am doing something wrong/something could go wrong. Right now of all the test cases that I have done, my code has worked but ...
1
vote
0answers
28 views

Producer/Consumer write to file

I'm concerned with the memory usage of this application. When I start it and look at it's memory usage while it's waiting for input, it's memory usage is around 13,212 K. When the application runs ...
2
votes
0answers
29 views

One class unit-tests

Its my first attempt to unit-test in Js. Not yet TDD. What I can change? EventsPersistancyService.js: ...