Thursday 30 November 2017

How do I write a buffer to a net TCP stream and send it to a server?

I'm still kind of finding my way around Node and net. Here is the code I have. I do add the port and host for testing.I got most of this code from an example in node docs: http://ift.tt/2AO26hk net = require('net'); const buf = Buffer.allocUnsafe(9); const client = net.createConnection({ [port,] [host] }, () => { buf.write('foo'); buf.writeUInt8(5, 3); buf.write('world'); console.log('connected to server!'); client.write(buf); }); client.on('data', (data) => { console.log('data is ' + data.toString()); client.end(); }); client.on('end', () => { console.log('disconnected from server'); }); Its saying 'connected to server!' but thats all im getting. I just know it wants a message starting with 'foo', the length of the rest of the message, and then 'world'.Anyone see any mistakes or able to offer advice?

Submitted December 01, 2017 at 01:33AM by BikesNotBums

Tips on creating a 1:1 chat/pm feature in web app

HiI'm creating a web app for my FYP, and I'm looking to implement a chat feature for users to chat. I want one user type to be able to message another user type. It also needs to be unique to these two users. Ie not every user can chat, just 2 users. I'm using Node and a mongo database. I've come across socket.io. Is that any use?Any tips/tutorial on how to achieve this?

Submitted November 30, 2017 at 11:22PM by andremac96

Using socket.io to show a canvas circle on all browser windows

I'm very confused what to do right now, I got my server set up where a user joins and it draws a circle. Another user can join, it draws another circle somewhere else. But each user is not at the moment able to see the other.Client-side code: http://ift.tt/2AmrV52 my server, there is nothing 'connecting' to the client-side code. I think I need to emit something (like what?) to each side (server - client) to be able to see the players on both.What should I add to see other players?Thanks!

Submitted November 30, 2017 at 11:39PM by Akidus

Solve "Source Path Too Long" issue while deleting folders in Windows. A common issue faced by nodejs users

http://ift.tt/2itZmyc

Submitted November 30, 2017 at 10:03PM by vishwasr

Some scope help.

I've inherited some node.js code and am still getting used to it. I'm having some trouble with variable scoping and have made a very small example to show where the problem lies.var RateLimiter = require('limiter').RateLimiter; var array = [0,1,2]; var limiter = new RateLimiter(1, 5000); for (var i = 0; i < array.length; i++) { console.log("i at for scope: " + i); limiter.removeTokens(1, function(){ console.log("i at removeTokens scope: " + i); }) } The output I get isi at for scope: 0 i at for scope: 1 i at for scope: 2 i at removeTokens scope: 3 i at removeTokens scope: 3 i at removeTokens scope: 3 So it seems i has finished incrementing before the log statements begin. I've been messing around with wrapping in functions and bind statements but I can't seem to solve it while keeping the use of the ratelimiter. Any help would be much appreciated.

Submitted November 30, 2017 at 09:36PM by anonmarmot

Push keeps overwriting previous data in an array

I'm trying to keep track of all users that join on a web game. All of sudden only 1 user is in the playerArray. My code seems to replace the last value(s) in my array with the new one. Not sure how this is happening.http://ift.tt/2AL1Gbt can I fix this?Thanks!EDIT: This code is on the server side.

Submitted November 30, 2017 at 08:24PM by Akidus

confusion about functions exiting without return statement

I'm relatively new to nodejs and asynchronous programming in general. I have a section of code that is composed of a function that returns a promise followed by 2 functions connected by "then":function func_with_a_promise() { return new Promise (function (fulfill, reject){ fulfill(); }) } func_with_a_promise().then( function(){ console.log("There is no return statement in this function") } ).then( function(){ console.log("But we still arrive here...") } ) The output of this code is:There is no return statement in this function But we still arrive here... I would expect that the output is just "There is no return statement in this function", and the final function would never be reached because the second function doesn't return anything. But in fact both the final two functions are reached and output to the console.I must be misunderstanding something, please help!edit: ok after posting this I did a bit of digging around. It seems that javascript functions don't need a return statement. If you don't return anything, then javascript automatically returns "undefined". Is this correct?

Submitted November 30, 2017 at 05:01PM by thenewstampede

Do Node web apps port easily into iOS / Android Apps?

Hey guys, I'm a total newbie to native iOS and Android development. Is it possible to use our existing NodeJS back-end in a newly built iOS or Android app? If so, what is the recommended modern approach for accomplishing this?

Submitted November 30, 2017 at 04:18PM by snahrvar

Microservice Architecture Best Practices

http://ift.tt/2zS7qA0

Submitted November 30, 2017 at 03:01PM by ThomasAbraham

Simple Form Submission to Backend. Why is req.body empty. Noob Error 🤕

Been tearing my hair out on this. Very grateful if anyone could explain where I'm going wrong.This is my HTML:
And this is my Server.jsapp.use(bodyParser.json()); app.use("/", expressStaticGzip("dist")); app.post("/contact", (req, res) => { console.log('anyone there?') res.json(req.body); }); The console.log works fine. I get an empty object for req.body though. Thanks for any help.

Submitted November 30, 2017 at 01:46PM by harrydry

Why Developers Choose Node.js

http://ift.tt/2jxqfO8

Submitted November 30, 2017 at 12:54PM by konstantinlev

Should I be looking for a memory leak?

I have a node web app hosted on a 1GB Linode VPS.Node (with express) is mostly used to serve json data. Some of the data is retrieved from another service through an API. The relevant part of the code checks if the data is stored in redis, if not then it makes an API call to the other service to retrieve them, processes the data a bit (nothing too intensive), saves them on redis and then responds.I also cache the responses with Nginx (which sits in front of Node) and with Cloudflare. The total number of requests for these data is about 120 per minute, but most of that is handled by Cloudflare and Nginx and only about 15 requests per minutes reach Node.Node can handle the 15 requests per minute if they are spaced out more or less evenly and the node process uses about 500MB on average. But if say 5-6 requests come at the same second then memory usage goes to about 850MB and PM2 restarts the process.Is that way too much memory use by the node process for so few requests? Should I be looking for memory leaks and/or inefficient code? Or is that within the limits of normal and I should just upgrade my VPS?This if my first node app so I have no point of reference.

Submitted November 30, 2017 at 10:56AM by Ozyzen

PM2 Control Panel

Hey guys, I just wrote an app that allows you to remotely manage PM2 instances. Is this even useful? Let me know what you think!Also, please try not to delete any of the actual instances, they are powering all of my other demos. :/ Feel free to restart, start, and stop them though.Demo link: http://ift.tt/2AkJl1T GitHub link: http://ift.tt/2Af0cVY

Submitted November 30, 2017 at 10:20AM by jacfearsome

Need help identifying best framework for my project's use case (mysql pub sub on various tables to stream data to front-end angular app)

Basically I'll be writing separate crons running on various servers that will push data to various tables in a mysql database on Amazon rds. I want to write a backend on nodejs that will stream these events (ie addition to data to various tables from my various cron jobs) to a front end angular app. My question being can something like socket io do that? or would it be better to refactor my crons to push data to redis and socket io pub subs to redis instead of mysql and redis periodically logs to mysql? I have done decent back end but never implemented anything like this- socket streaming with pub sub.I haven't started my project and maybe my architecture is wrong, I am open to any suggestions.

Submitted November 30, 2017 at 07:29AM by boldEagle15

Callback Hell in Nodejs: A Solution With Fiber - DZone Web Dev

http://ift.tt/2ipLKEd

Submitted November 30, 2017 at 07:30AM by mobileforms

Wednesday 29 November 2017

How to handle errors in Express

http://ift.tt/2BxVCQR

Submitted November 30, 2017 at 06:03AM by cstuff8

Using async package, how do I break out of "forEachSeries"?

Hi all,I'm using the async package in order to iterate over arrays of objects. I'm using a function called "forEachSeries". This might be the same thing as "eachSeries".If you're not familiar with this function, it simply iterates over an array with some code that has a callback function. It's basically a for look that operates over an array. The only problem is, I can't figure out how to break out of the loop if I need to.For example, if "forEachSeries" has only iterated over half the array and I have determined that I need to stop the execution of that function, I can't figure out how to break out of the loop. The only thing I can think of is to set a flag outside the loop, then encapsulate everything inside the loop with a check to see if the flag has been triggered. If I determine that I need to exit the loop, I'll just trigger the flag. Then each iteration will skip the code to execute and simply call the callback function. That seems horrifically inefficient, since I still need to iterate over the rest of the array even if I don't do anything.Is there a better way to do this?Here's an example of what I'm talking about. Let's say that I have an array of letters called "letters" that just contains some letters. I want to output each of them to the console, one by one. After I output my first letter 'c' I'd like to stop. So I've set up a flag called "continue_flag" that is true as long as I want the loop to continue. Once I run into the first 'c', I set the flag to false, but I still iterate through the array anyways without doing anything meaningful.I can't seem to get the code to format properly but it begins below:var async = require("async");var letters = ['a', 'b', 'c', 'd', 'e'];var continue_flag = true;async.forEachSeries(letters, function(letter, callback_function){ if (continue_flag){ //continue_flag is true console.log(letter) if (letter == 'c'){//check to see if the letter is 'c' continue_flag = false } callback_function(); } else {//continue_flag is false callback_function(); } } );Is there a better way to do something like this? Is async.forEachSeries even the best function to be using?Thanks!

Submitted November 30, 2017 at 12:44AM by thenewstampede

Starting out with WebSockets - How to realize rooms?

I'm coding a website with a Node/Express backend and Vue frontend, and now I need Websockets and I don't have any experience with that. I've been googling the last two days and I almost made no progress, so many options!I've seen ws being recommended tons of times, especially more recently, while socket.io seems to be a bit bloated, and fallbacks are not needed as much anymore, with standard ws being more and more supported.I'd gladly go with WS, but sadly, it doesn't look like it has rooms/channels/broadcasts. Is there a way to recreate this? I've also seen socketcluster.io recommended, but that seems to be a pain to add in an existing project and slightly overkill already. Another question would be: If you use WS, do you use any WS modules on the frontend to make your life easier, or is the native WS good enough for sending stuff back and forth?tl;dr: websockets module for a noob with good docu and rooms/channels? Thanks!

Submitted November 29, 2017 at 10:34PM by zonq

Learn node js

How to learn node js back end for beginner?? Give me step by step pls :(

Submitted November 29, 2017 at 06:31PM by sekende

Moving a Node.js app from PaaS to Kubernetes Tutorial | @RisingStack

http://ift.tt/29Lmuhu

Submitted November 29, 2017 at 05:33PM by apang7

Some best practices and tips from our experience with node logging, a little plug at the end but you can ignore it :)

http://ift.tt/2ii4IfP

Submitted November 29, 2017 at 05:01PM by ArielAssaraf

Basho: Shell scripting and automation with plain JavaScript

http://ift.tt/2ieDc2J

Submitted November 29, 2017 at 03:34PM by jeswin

What is the best way to implement validation in Node.JS?

I am getting used to Node.js, but I still have a hard time understanding how I should perform validation in Node.jsFor model validation, using an ORM I think is usually a good idea. For instance, Sequelize let you define the models and apply validation on the model's fields directly in the model definition.But if I have to validate other parameters, for instance, I want to validate a certain query parameter that tells how to respond to the client when it requests data, what is the best way to do it? What is the "state of the art" of nodejs validation? What do people use?It is really confusing looking to packages because there are so many that it is really hard to choose or understand which ones are worthy and which ones are not.

Submitted November 29, 2017 at 02:31PM by honestserpent

Exporting node.js error codes as constants for node > 8.0

Node.js 8.0+ added error codes instead of just message, but it's still strings!!I created a tool that extracts the error codes from node.js source via Babylon parser and outputs them into ES6 modules.But I'm not sure of the API, should I export them as constants, or an object.Check the project out and PRs welcome.http://ift.tt/2ijuekC

Submitted November 29, 2017 at 11:43AM by cswl1337

Build a "Serverless" Todo List in 5 Minutes with StdLib and MongoDB

http://ift.tt/2Akv7jU

Submitted November 29, 2017 at 11:35AM by keithwhor

Zafiro is a strongly typed and lightweight web framework for Node.js apps powered by TypeScript, InversifyJS, TypeORM and Express

http://ift.tt/2AjT9eU

Submitted November 29, 2017 at 09:37AM by ower89

Tuesday 28 November 2017

Basic NodeJS blockchain implementation walkthrough

http://ift.tt/2jtveiU

Submitted November 29, 2017 at 12:15AM by dbdjsdev

Newbie question: Do you recommend developing with or without express (creating Angular2 app)

I'm starting to build the server side of my app and I'm trying to keep my app as simple as possible and with each additional framework, the app gets more complicated and learning curve increases. However I see that express is basically recommended everywhere. Is express to node like jquery is to javascript?I know I don't have to use it, I also rather not. But if it makes developing much more easier, and it doesn't make the app slower for the end-user then I'm all for it.

Submitted November 28, 2017 at 06:11PM by yodalr

Migrating a Mocha project to Jest Test Framework - without writing a single line of code (almost ☺️). A practical real-life project about the use of codemods and jest.

http://ift.tt/2hWXx8Z

Submitted November 28, 2017 at 04:53PM by lirantal

Assert(js) JS testing conference speakers & talks, and early-bird price expiring

http://ift.tt/2AfaCFm

Submitted November 28, 2017 at 05:01PM by pauldowman

Tutorial - Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!

http://ift.tt/2Aesz6M

Submitted November 28, 2017 at 04:40PM by Eknaths

VSCode debugging: Throwing errors of missing package.json files and missing modules - the files are there

I can run my application normally, when using npm start. It also works. But when I try debugging it, it throws errors of missing modules in fs.js and module.js:...\node_modules\require_optional\index.js\package.json ...\node_modules\mongodb-core\index.js\package.json Cannot find module 'bson-ext' I have no idea what is going wrong here, yesterday I was able to debug without any errors, now when I tried it today, it does that.I have already tried deleting node_modules and installing it again, as well as running npm update and npm rebuild. I'm programming this using TypeScript, and I re-transpile the code every time before starting the debugger.Any ideas as to how to fix it?I'm thinking that the error may be with my tsconfig and package.json files, but I have no idea how to fix it.

Submitted November 28, 2017 at 04:24PM by SixLiabilities

The Performance Cost of Server Side Rendered React on Node.js

http://ift.tt/2zSXRjh

Submitted November 28, 2017 at 12:32PM by ginger-julia

How I Got Into #Node: Matteo Collina

http://ift.tt/2iXrrgV

Submitted November 28, 2017 at 12:28PM by harlampi

Dockerised ExpressJS services refusing to shut down on SIGTERM

Hello,I am running Dockerised Node.js services using Express on AWS ECS, and I'm finding that upon deploying a new version of my application, the currently running task refuses to stop, until it receives a SIGKILL after 300 seconds and is forcefully brought down.Any idea how I can have the servers stop as soon as they're told to..?

Submitted November 28, 2017 at 11:15AM by nearxanldn

Making Promises safer in Node.js

http://ift.tt/2AdbwBJ

Submitted November 28, 2017 at 11:20AM by nearForm

Express architecture for REST server

We are creating a REST server using Express, storage using MYSQL. There are two main components:1) REST endpoints that will be consumed by an app. These endpoints generally query the MYSQL db and return JSON.2) A 'synchronise' component that will retrieve data from an external web api and populate the MYSQL db.Question: Is it preferable to create the synchronise component as a separate node app running on its own process to ensure that the response performance of the REST server is not impacted by retrieving external data and writing to the db?

Submitted November 28, 2017 at 10:47AM by cupofwater5

Express.js: Logging info with global unique request ID - Node.js --> Interesting blogpost from my colleague

http://ift.tt/2i9rgzj

Submitted November 28, 2017 at 09:33AM by n3twor

StdLib Platform Updates: Functions Run on Node 8.9.1, Static Binary Support (x-post r/javascript)

http://ift.tt/2zKGbaT

Submitted November 28, 2017 at 07:19AM by J-Kob

Monday 27 November 2017

Yep, ActionHero.js works just fine with nodejs v9

http://ift.tt/2ACU22J

Submitted November 28, 2017 at 05:32AM by evantahler

Quickly generate REST APIs with ExpressJS and Swagger - features automatic request validation, interactive api doc, and more...

http://ift.tt/2t1IlMc

Submitted November 28, 2017 at 02:47AM by coracarm

Logging and winstonjs

Hi guys, this may not be the best place to ask but I am starting to think that winstonjs may be dead and I am starting to look for a replacement. Any recommendations? my needs are the following:- Colored console output and logging levels.- File writing with multiple formats.- Log rotation.- Logstash / elastic stack integration.Thanks in advance!

Submitted November 27, 2017 at 11:19PM by PalomSage

what do you think about egg.js node framework ?

http://ift.tt/2bQiUna

Submitted November 27, 2017 at 10:51PM by EZPZ420

What is the best approach to handling errors in Production of express.js / node app?

I know errorHandler is only used for development, but what about your approaches for Production?const errorHandler = require('errorhandler');// routes app.get('/', homeController.index);// error handler. app.use(errorHandler());

Submitted November 27, 2017 at 10:59PM by _Nodejs

Question about CSRF and AJAX

I'm using csurf of a project with simply an app.use(csrf()) as middleware. I'm stuffing the CSRF token into my handlebars templates on the res.render('template', {csrfToken: req.csrfToken()}). Everything is working fine.The problem I'm having is as follows. A certain registration form uses an AJAX call to verify if an email is available as part of the form validation. This AJAX call is able to grab the csrf token from the rendered page, but that CSRF token is "used up" in this process. The request has now caused the middleware to generate a new CSRF token, and now the form (which was rendered two requests ago) has the wrong CSRF token.What are my options here? I was basically going to change the CSRF configuration so that only my actual form post routes are CSRF-protected and let the checkemail route (which only AJAX ever talks to) run without CSRF.How are others handling this?

Submitted November 27, 2017 at 05:15PM by 64bitHustler

I guess ↘️ is the new left-pad

I have been seeing more and more seemingly useless packages on NPM lately. But today I find one that is going to be hard to top : ↘️.So is it another case of left-pad ?Or did the author create this package as a weird attempt to sarcasm ?Or is it a stupid piece of over-engineering ?Or is it a weird attempt at being more popular ? I mean there are hundreds of emojis (and other unicode characters) you could create such package for...Or is there something I don't get about Node packages that makes this one totally legit ? In which case, wtf ?!Edit to Mods: Seems this character breaks Reddit's layout a bit. Sorry about that :/

Submitted November 27, 2017 at 06:21PM by captain_obvious_here

Tutorial - Learn by example building & deploying real-world Node.js applications from absolute scratch

http://ift.tt/2ADEaNB

Submitted November 27, 2017 at 05:57PM by Adaks

Scaffolding a NodeJS GraphQL API server

http://ift.tt/2zH9cEk

Submitted November 27, 2017 at 03:31PM by mcmouse2k

How to send X amount of requests per Y seconds?

Greetings,Is there any elegant and simple way (or node_modules) for me to send X amount of requests per Y seconds?Currently what I have is:// stop application after 1sec setTimeout(function() { clearInterval(requestInterval); }, 1000); // loop every 200 milliseconds to send request function loop() { requestInterval = setInterval(function() { // send request loop(); }, 200); } loop(); The above code should send 5 request and then it would stop, but my problem is I couldn't get it to send EXACTLY X amount of times, when I set a lower value of setInterval time, it would send request more than the amount I wish to send.Sorry if my question is not clear. Thanks in advance.

Submitted November 27, 2017 at 02:59PM by xjellyfishx

For you, what makes node better then the alternatives?

Currently I’ve been thinking a lot why I like Node so much, and really, I have no idea. Maybe it’s just because I like JavaScript.

Submitted November 27, 2017 at 03:10PM by OzziePeck

Finally, is there!! Auto-document your Node.js API using Swagger (OpenAPI) module for NestJS

http://ift.tt/2ABjXrE

Submitted November 27, 2017 at 03:11PM by mysliwik

Anyone else who doesn't want to use Express for webdev can help me?

I would like to know a way to develop a "simple static website" and way to maintain design without using some (API) heavy framework like Express?For some reason I just don't want to use Express. It seems too huge and clunky with an abstract layer on Node.js, which I rather avoid.

Submitted November 27, 2017 at 09:03AM by XalAtoh

Custom errors and error logging in Node.js+GraphQL.js API project

http://ift.tt/2zHKK5O

Submitted November 27, 2017 at 08:05AM by koistya

Running the Node.js Bookshelf on Compute Engine

http://ift.tt/2A5Iyob

Submitted November 27, 2017 at 08:25AM by katerina-ser60

Node.js: What's Next? - James Snell

https://www.youtube.com/watch?v=hVfQ8KtRptM

Submitted November 27, 2017 at 08:34AM by r-wabbit

Currying is not idiomatic in JavaScript

http://ift.tt/2AzPbw0

Submitted November 27, 2017 at 08:54AM by fagnerbrack

A tool to protect Node.js App

https://n.vlinx.io

Submitted November 27, 2017 at 07:23AM by vlinx2016

Sunday 26 November 2017

10 Reasons that Make Node.js a Top Choice for Web Application Development

http://ift.tt/2n6qEMF

Submitted November 27, 2017 at 06:37AM by 2sbro

ClusterWS lightweight, fast and powerfull framework for developing real time applications, allows to scale websocket horizontally and vertically

http://ift.tt/2ybO8nL

Submitted November 27, 2017 at 12:13AM by goriunovd

Ideas for settings up and manipulating a queue system

For an small project I'm working on, I need to set up a queue system and rather than trial and error all the ideas I've had for doing it, I thought I'd ask for ideas. My stack is relatively simple. Node, Express, PUG view engine, MongoDB + MongooseAn application that might function similar to what I'm looking for would be like an email queue. You can add a new email to the queue, edit an email that's already in the queue, and re-order emails that are in the queue. Then a cron job would be scheduled to send out the next email in the queue. Again, I'm just looking for ideas about how to manage and persist the queue order.Currently, my best idea is to simple start a new DB collection with a single record. It would be an array of ID's, and it's order would be the order in which the queue would function. I could add a new item to the queue, and add it's ID to the array, move IDs within the array around to re-order the queue... etc....Anyone ever done something like this before?

Submitted November 26, 2017 at 10:52PM by SableElephant

Would anyone mind looking at my server code?

Here's the code. Here's a picture of the file layout.I'm mostly interested in the errors I have probably made in /server/scripts/server.js. I guess my two primary concerns are:Only the public directory should ever be served.I'm not entirely sure about which headers to set. Do I Need to set Last-Modified and Cache-Control when serving a file for the first time? When I get any request with the If-Modified-Since header can I simply return 304 and be done with it? Are there any other headers I'm not handling right?But any additional corrections you have would be great. The UI is just there for something to look at. I haven't got past focusing on the server code yet.*I would prefer to roll my own server instead of using express. I know about express.

Submitted November 26, 2017 at 09:30PM by Nobody271

NodeJs with ExpressJs + ReactJs inquiry

I'm building an app with React and node, I want to know how to connect the client with the server.Up until now I've gotten information from the server by fetching the api with fetch promisesI'm trying to build a login form, however how do i connect do I send the post http request from my react component to my express controller?Thanks btw.

Submitted November 26, 2017 at 07:36PM by ecruz255

I love node

I'm sorry this is probably super cliche for those new to node, but I love it so far. After using rails, it's just really nice to do some simple routing, setup a db and then have a simple web app up and running in an hour or two. Excited to learn its strengths and weaknesses, but for now, I'm a fan.

Submitted November 26, 2017 at 07:17PM by grouphugintheshower

libijs - A library for communicating with iOS devices over USB

http://ift.tt/2jpClbV

Submitted November 26, 2017 at 03:20PM by kbpp

Simple embedded database

I started to work on a personal media server project. I want to use a database but I want to keep it embedded with with the possibility to move to mongo if I need it later. There is so many choice that I'm lost. I also want a simple odm for my schemas and relations. I want to create a graphql endpoint for my frontends.. Web gui in react and mobile with react nativeI looked atlokijs.. I didn't like it because it was not using promises to load the database. I guess I could just start my web server in a callback.I looked at pouchdb but couldn't make it persist the data to reload it later.. Probably my fault.I looked at nedb.. Seems nice and all but it's not active anymoreLowdb is pretty good but the odm is not stable..Is there any other good embedded database for node.What are you guys using for this kind of small case applications max 5 to 10 people connected to it?Thanks

Submitted November 26, 2017 at 02:50PM by inkubux

Having trouble with express/passport/mongoose

I'm trying to accomplish user login/signup with passport.js by following scotch's tutorial, with TypeScript.I have finished following the signup part.. When testing it, I am getting nothing. The page just refreshes and nothing happens on the server.I've been trying to debug the incoming request, but I don't know how to do that. I'm used to Visual Studio with C#, everything I know from there doesn't work here. The guides on the visual studio code page aren't helpful.I've posted this queston on stackoverflow, but haven't gotten any responses. Here it is. You can find the relevant parts of the code there, too. I hope this is not rude or something, I can upload the code here too - I just think it looks nicer on stackoverflow.

Submitted November 26, 2017 at 11:48AM by SixLiabilities

Introducing MagiCLI: Automagically generates a command-line interface (CLI) for any module

http://ift.tt/2hnV76Q

Submitted November 26, 2017 at 10:53AM by harlampi

Having troubles making a GET request to express server.....

I am running an express server on 127.0.0.1:8080 and I am running an http-server for the client side on 127.0.0.1:8081.Here is the code.I am able to make a request to http://127.0.0.1:8080/, but not http://ift.tt/2zF5tal, I get a CORS error. I know that the server receives the requests (for http://127.0.0.1:8080/ and http://ift.tt/2zF5tal), because it writes to console.Failed to load http://ift.tt/2zF5tal: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8081' is therefore not allowed access.What I am doing wrong, please help !!!Thank you.

Submitted November 26, 2017 at 07:25AM by CheBurashka_GG

Saturday 25 November 2017

Potentially unhandled rejection [5] No endpoints could be reached (WARNING: non-Error used) Potentially unhandled rejection [5] No endpoints could be reached (WARNING: non-Error used)

I try to deploy my nodejs apps in Heroku and I'm getting this errors. Not sure why this happens.Im using several addons : Cleardb, Mongodb and RabbitMQPotentially unhandled rejection [5] No endpoints could be reached (WARNING: non-Error used)

Submitted November 26, 2017 at 06:32AM by jakzaizzat

OK, Now I'll learn How To Program In JavaScript!

http://ift.tt/2A63UPz

Submitted November 25, 2017 at 11:32PM by fagnerbrack

If any user ID is equal to another that's connected to the nodeJS app

I want to be able to give a user a random ID that does not match anyone else's that's on the server.I'm using this for a random ID:function getID() { var number = Math.floor((Math.random() * 10000) + 1); return number; }I need to add a function that will detect that if the ID of a player in: [{id: id, leaderName: username, score: score, defeats: defeats}] (using players.push method to add a new set of variables to the array for each player) this array, but I'm stuck at my for loop:for (var i = 0; i < players.length; i++) { if(players[i].id === ) }I don't know what to put to make it test if the id is equal to any other on the server. What can I put to test all the players[i].id, and fix the id is not defined issues?

Submitted November 25, 2017 at 09:28PM by Akidus

Async/await - A thorough example - Kostas Bariotis' Blog

http://ift.tt/2BnpUpa

Submitted November 25, 2017 at 09:24PM by kostarelo

randent - simple, light cryptographically secure random number generation in Node

http://ift.tt/2zDOB3K

Submitted November 25, 2017 at 09:14PM by Etha_n

Vaxic - the powerful, lightweight Node web framework

http://ift.tt/2i5A3lB

Submitted November 25, 2017 at 08:11PM by Etha_n

Node.js unofficial client to Purse.io API

http://ift.tt/2zEgKaA

Submitted November 25, 2017 at 07:38PM by roccomusolino

Managing Embedded Documents with Monogram

http://ift.tt/2BmEJbB

Submitted November 25, 2017 at 07:55PM by code_barbarian

Where can I learn how to convert a callback route to promise version?

Hi! I recently learned about 'callback hell' and I would like to rewrite my routes to use promises instead of callbacks but I have troubles understanding how to actually write it.For instance, I have this route:router.post("/books/:id", (req, res) => { let { id } = req.params Books.findByIdAndRemove(id, err => { if (err) { return res.status(500).json({ err: "Book ID not found" }) } return res.redirect("/home") }) })Is there a resource out there that can help me understand how to achieve this? I don't understand where I should use my 'then' keyword and so on.Thanks in advance!

Submitted November 25, 2017 at 04:16PM by tradehodlrepeat

Has anyone tried web scraping on MEAN stack?

Hey guys, I've created a node app and would like to scrape some data. I've heard that Python is the best language for scraping, but I'm curious: is there a way to accomplish the same results through Node.js or Javascript?I'm trying to learn as much as I can about this subject and any expert advice would be much appreciated!

Submitted November 25, 2017 at 04:26PM by snahrvar

Cryptocurrency Prices Straight Outta CLI 💰

http://ift.tt/2jXSTMh

Submitted November 25, 2017 at 01:43PM by thickoat

Introduction to using React for templating with the Koa framework on Node.js with TypeScript

http://ift.tt/2zBENai

Submitted November 25, 2017 at 12:06PM by velmu3k

Writing fast and safe native Node.js modules with Rust

http://ift.tt/2BdEBuT

Submitted November 25, 2017 at 09:28AM by dobkin-1970

Is it hard to deploy nodejs/express site to the VPS (OVH)?

So I found a nice black friday deal on OVH website I and think I should buy it because I only heard great things about OVH.The problem is I actually never deployed Nodejs app to the production server so far. There are a lot of tutorials to deploy it on Herkou or DigitalOcean but how could I deploy it on VPS? What would be the steps?How would I secure it, connect domain to it or add https? I know I am asking too much but some general guidance would be awesome. Thanks. :)

Submitted November 25, 2017 at 08:01AM by nikola1970

Friday 24 November 2017

Client -> Server -> Client not working properly

I tried to emit a username variable to the server using: socket.emit('set username', 'text-username');.This emits successfully (I think) because the alert message following shows up successfully.On the server.js, the following code is under the io.on('connection',...socket.on('setUsername', function (username) { console.log(username + ' joined'); });Yet, I don't get test-username joined in the console when I submit the form.Other things work well on click on the form. What's wrong?

Submitted November 25, 2017 at 02:48AM by Akidus

question about requests from node app with nginx on top

I have a nodeJS front end application that has nginx on top. The nginx is configured such that the the front end, as well as several other REST services are all under one domain. I.e. the front end would be site.com, and the services would be site.com/api/. The front end is simply calling ajax with a url without the whole host name...i.e. fetch('/api') I also need to make some calls on the front end's server side to the other services. However, with the request library, I cannot make a call without the full URL. I have two options.1) Set the full URL to be the common one that NGINX proxies all traffic from....i.e. my request on the front end server would to go site.com/api,2) I would call the actual URL of those services.Any advice? Thanks in advance.

Submitted November 24, 2017 at 08:14PM by rhetoricl

Node.js Weekly Update - 24 November

http://ift.tt/2A2I6Gq

Submitted November 24, 2017 at 03:45PM by hfeeri

How do open source projects get more help from others?

These days, I'm working on a project about Algorithms and utils for Machine Learning in JavaScript. I'm a beginner in machine learning, so I need other people to help me. So how to attract others to contribute?If you are intersted about this project, I need your help. Any issues and pull request and ideas are welcome.github: http://ift.tt/2xFZH73

Submitted November 24, 2017 at 03:50PM by laoqiren

Running Node.js modules with multiple functions efficiently on AWS Lambda and Google Cloud Functions

http://ift.tt/2yOtb3d

Submitted November 24, 2017 at 01:31PM by fptavares

The State of Node.js & JavaScript for Backend Development

http://ift.tt/2hXH6Nj

Submitted November 24, 2017 at 11:02AM by ThomasAbraham

I ❤ JavaScript: Mysterious Comma operator

https://www.youtube.com/watch?v=Vb42kIvAZL4

Submitted November 24, 2017 at 10:19AM by r-wabbit

Free eBook: Node.js Design Patterns - Second Edition [PDF,ePub,Mobi and DRM free]

http://ift.tt/2iK30ks

Submitted November 24, 2017 at 09:11AM by PacktStaff

The Most Clever Line of JavaScript

http://ift.tt/2hTqClZ

Submitted November 24, 2017 at 08:20AM by fagnerbrack

Thursday 23 November 2017

Need help getting node API up and running.

How to run a hot-reloading node app inside a docker container and connecting it to a private Ethereum node.

http://ift.tt/2A7E0L6

Submitted November 23, 2017 at 07:40PM by mordhau

Node.js - a tale of two bugs

http://ift.tt/2z11GiP

Submitted November 23, 2017 at 06:51PM by r-wabbit

duck-check: A minimalist runtime type checking utility

http://ift.tt/2zx6m4o

Submitted November 23, 2017 at 03:55PM by Tioo

Are there good databases that stay local?

Hey, i want to learn node and with that i want to learn a database. The thing is that i started a git project for it and i want my database to be so versatile that i can include it in git if i want to, or that i can make a local copy of it.Is there a database that can do this? Is my thinking wrong?I dont want one database for each system, i want one for each folder, so that i can start and end different projects however i would want to.

Submitted November 23, 2017 at 02:23PM by Anoian

Node.js Vs PHP: The Differences In Mobile App Development

http://ift.tt/2BgCwhO

Submitted November 23, 2017 at 01:16PM by GregTheAlmighty

Wednesday 22 November 2017

Are all those node_modules required?

Every time I start a project, I get 200+ MB of node modules. Are they are required to start the project?If not, is there a way so I only install the ones I need?

Submitted November 22, 2017 at 11:24PM by eggtart_prince

Best practices for a Node API in production?

Hey all. I'm using NodeJS for a production API and have a few questions about "best practices" when it comes to memory settings.I'm using pm2 as a process manager and have "max_memory_restart" set to 3GB. This was needed to avoid out-of-memory exceptions during a particularly intensive cron job. (We're working on making this cron job less intensive)We set max_old_space_size to 4096 (aka 4.9gb) to avoid the out-of-memory exceptions mentioned above.This has fixed our issues with the cron job but our API will periodically go down for no reason at all. Are these settings to high?

Submitted November 22, 2017 at 10:09PM by mrc1897

Using Node and playmusic to get Google Play Music working on a Raspberry-Pi-powered carputer

https://youtu.be/XNTiGanpf3s

Submitted November 22, 2017 at 10:12PM by Autsin

Writing fast and safe native Node.js modules with Rust

http://ift.tt/2BdEBuT

Submitted November 22, 2017 at 08:03PM by hfeeri

Why are there no good nodejs slack, discord, glitter communities?

Does that say something about node developers? Laravel, Wordpress, and Golang have very active communities.

Submitted November 22, 2017 at 05:34PM by l2silver

Node.js Versions Used in Commercial Projects in 2017

http://ift.tt/2iFWTxk

Submitted November 22, 2017 at 03:38PM by mmaksimovic

A brief note from r/node moderators

TLDR: Nothing much is changing around here but please be cool and respect reddiquette.Hey fellow Redditors,It's been a bit high-drama here at r/node for the past couple of weeks. We have received messages asking us to comment on our moderation policy and to implement a code of conduct.As moderators, we discussed this internally and decided to wait until everything had cooled down before responding. With the drama no longer on the frontpage, that time is now. Some may be annoyed that this will be mostly a null response.At r/node we like to take a light-touch moderation approach when it comes to expressions of opinion. Regardless of whether the mods agree or disagree with opinions, we will generally allow them to be expressed. Please keep in mind the first two values of reddiquette when expressing your opinion:Remember the human.Adhere to the same standards of behavior online that you follow in real life.This is your subreddit. If you're sick of all the Node politics and wish to return to a subreddit of code and love and unicorns, then please use the powerful arrows to cast your vote and make the frontpage a place that reflects your interests and values.

Submitted October 04, 2017 at 12:13PM by bittered

Sending Emails using Sendgrid with Node.js

http://ift.tt/2yB7xvW

Submitted November 22, 2017 at 01:03PM by harlampi

Putting the helmet on - Securing your Express app

http://ift.tt/2hTCM1u

Submitted November 22, 2017 at 11:57AM by js_dom

Tuesday 21 November 2017

Simple CLI for Express.js with route controllers + hot module reloading of routes.

http://ift.tt/2BbL6P8

Submitted November 21, 2017 at 08:31PM by cutcopy

We're close to launching a $5/1GB/20y web hosting with *limited* Node.js support. Care to test?

Hi everyone,So yeah, you got that right, we're seriously considering hosting a gigabyte of stuff for $5 for 20 years or around $0.02 a month. Because we want websites to stop disappearing from the web because you missed your monthly payment.Now obviously, we can't run a proper VPS for every user at that price and if we did we'd probably be lying about being ready to keep it up for 20 years. No less obvious is that pure static hosting is useless for many cases.So I came up with this idea to run server-side JS on demand. You get 5 seconds to start up, accept and process a HTTP request and clean up. Stateless, shared-nothing, like in good ol' PHP times. And if you need a database we have SQLite (also considering adding LevelDB).I duct-taped together two levels of LXC and several daemons in two days, and it does seem to work, but there are certainly problems (and possibly still some vulnerabilities). So I'm wondering if any one of you is interested in toying with this today, before the public launch (should happen within 2 days).Obviously, you get a free lifetime account for your efforts (valued at at least $5!!! :D).I don't want to disclose the name publicly yet, so I'll send you that and some instructions in a PM.Also feel free to ask me stuff.

Submitted November 21, 2017 at 06:09PM by virtulis

Monitoring the performance of a Node.js web application (DIY APM)

http://ift.tt/2hJ0Ssi

Submitted November 21, 2017 at 04:41PM by ecares

Please consider helping with /r/changemyview's DeltaBot code!

http://ift.tt/2zYch1F

Submitted November 21, 2017 at 02:47PM by Snorrrlax

A mock server for rest apis

Hello everyone.I'm learning Node.js. So, I'm implementing a mock server, the idea is that you can have a rest api for CRUD requests up and running with no time. it will use nedb to store your requests in a local database, so you can use it in different projects without interference.My intention was to (implement something in node.js, obviously, and) create something to facilitate the development of front-end applications or prototypes without the need to worry in creating a server for it.Any critics or advice will be very welcome.http://ift.tt/2mKXemS!!

Submitted November 21, 2017 at 11:55AM by balliegojr

npm-graveyard, a place to transfer the npm modules that you no longer want to maintain

http://ift.tt/2iBXGiL

Submitted November 21, 2017 at 10:28AM by superwolff

E2E Testing Angular Applications with TestCafe ← Alligator.io

http://ift.tt/2AiU3J5

Submitted November 21, 2017 at 08:38AM by krylovanatu

Serverless Node with AWS Lambda, API Gateway and DynamoDB

http://ift.tt/2hbrQsC

Submitted November 21, 2017 at 09:41AM by dobkin-1970

Node.js core values

http://ift.tt/2zKVCPY

Submitted November 21, 2017 at 09:50AM by fagnerbrack

Monday 20 November 2017

Fortuna: a better (and slower) random number generator implemented in JS

http://ift.tt/2hQhZMw

Submitted November 21, 2017 at 05:13AM by sethito

How would I run a specific node service with elevated privileges Linux environment?

This is a question that is probably as much Linux-related as it is node-related, but I think this may be the best place to ask..I'm developing an app that is targeted at Raspberry Pi 3 running Raspbian Stretch-Lite (Ubuntu). For the most part, it's a straightforward web app, but I want my users to be able to configure the device's network settings and system time from the web app.It's going to be running in somewhat sensitive environments, so security is a big concern. What I'm thinking is that I write all of the standard CRUD stuff in one app, but have a second microservice running with elevated privileges that will be responsible only for the time/network configuration, minimizing the api surface area that is exposed with elevated privileges. I'd have both behind an Nginx reverse proxy to route requests to the correct instance.I'm planning on starting up my app instances with pm2. Is there a way that anyone knows of to use pm2 to spin up apps with different privilege levels? Is there a better way I can be going about this?Thanks in advance for any advice.

Submitted November 21, 2017 at 04:54AM by LetReasonRing

Best package for reading excel files (xlsx)?

Hey guys,I'm undertaking a new project which requires that I read a vast number of excel files. There seem to be half a dozen different packages that are geared towards handling excel files, so I was wondering if I could get some recommendations about which package is the most effective.I tried using exceljs, but I got a "Unclosed root tag" error whenever I tried to open any of the excel files.I don't need to write to excel files, I simply need to read them. Each file will have 10+ worksheets in them, the number of worksheets being different from file to file.Thanks!

Submitted November 21, 2017 at 01:01AM by thenewstampede

🗺 High Quality GeoJSON maps programmatically generated. (Click on images to show a preview)

http://ift.tt/2hG3xCT

Submitted November 21, 2017 at 12:04AM by simonepri

Lightweight WebSocket wrapper library with socket.io-like event handling, requests, and channels

Are you considering moving to native WebSockets? They work on all modern browsers, after all!This library might be useful if you want some socket.io functionality (i.e. event handling, namespaces, etc.), but you don't want all of the engine.io transports and lots of extra code in your project. This library just wraps a native WebSocket and handles some basic stuff for you: like message passing, event handler stuff, etc.When using this library in conjunction with a library like ws, your real-time web application can be pretty darn lightweight without giving up the nice bare-bones functionality you might find in Socket.io.Check it out! I'd love some feedback. Is it useful? Lame?

Submitted November 20, 2017 at 10:21PM by compwiz737

Mongoose matching username and password

I'm trying to find the user name that is submitted and see If Its password is matchedhttps://pastebin.com/9MZ422L4I don't know what I'm doing wronghttps://pastebin.com/KY5C4AtLI Hope you can help

Submitted November 20, 2017 at 05:52PM by Cangasevere

Server end error?

I am having trouble with, I assume, my node.js server, but only when it finishes, I get an error, but it does go to the server, break points in Visual Studio confirms. I think it may have something to do with xhrStatus.AngularJS 1.6.6:$http({ method: 'POST', url: 'http://localhost:1337/eventCreator', data: $.param(data), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }) .then(function success(res) { $scope.errorText="SUCCESS: "+JSON.stringify(res); } , function error(res) { $scope.errorText="ERROR: "+JSON.stringify(res); });Node.js:router.post('/', function (req, res)//, urlencodedParser { res.writeHead(200, { 'Content-Type': '/' }); var eventDate = new Date(req.body.date); res.end("1"); });AngularJS Error message:{"data":null,"status":-1,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"http://localhost:1337/JL","data":"leader=batman&members%5B%5D=superman&guests%5B%5D=WonderWoman&date=Tue+Nov+28+2017+00%3A00%3A00+GMT-0500+(Eastern+Standard+Time)","headers":{"Content-Type":"application/x-www-form-urlencoded","Accept":"application/json, text/plain, /"}},"statusText":"","xhrStatus":"error"}

Submitted November 20, 2017 at 03:40PM by TheMadnessofMadara

Architectural problems

Problem: I got a web portal where the end users are customers of my costumers. The web portal has a set of core functionality, but is still supposed to be tailored to the needs of multiple different customers.These customers are producers or retailers and have their own different products which their customers can interact with. What functionality that is connected to these individual products can vary from product to product, even though it's made by the same producer. The same goes for the required authorization level to access some of these functionalities.My question is how do you structure for such a high grade of variation? Should it be done at database level, backend or frontend?I'd prefer a method that isn't to complex, but still flexible. Atm I have done a lot of these adaptations on database level, each product knows what functionality is connected to it based on table data. And based on this different functionality is displayed in my React frontend, however I'm unsure if this is an unhealthy way to structure the project? Seems like all options got pros and cons.

Submitted November 20, 2017 at 02:06PM by Archheretic

Mongoose Unique username

I tried to make to It refuse to Insert the user to the database If It already Exists but It doesn't workI want It to refuse to Insert the new username If It already ExistsHere's my Code so far http://ift.tt/2zSaE5V is a mongoose Schema and unique and required are set as true

Submitted November 20, 2017 at 01:15PM by Cangasevere

Nest.js Brings TypeScript to Node.js and Express

http://ift.tt/2yt1xZi

Submitted November 20, 2017 at 10:52AM by dobkin-1970

nm-prune: Pruning unnecessary files from node_modules (uses Node instead of Go)

http://ift.tt/2zl3rM6

Submitted November 20, 2017 at 10:41AM by bittered

How to make your Own Gumroad or SendOwl ?

I want to sell a digital product & it would be available after money is sent into my bank account. So I need to create something similar to Gumroad & SendOwl. I don't want to go their way bcz they take a lot of money when u make a lot. So how do I make it such that its secure enough. Like you cannot download file if u didn't do the payment even if u have the link. I want to know what to use for File Storage like S3, etc. as I have no experience with AWS at all. Then what about security. Please explain everything in details. Any help will be appreciated. Thank you.

Submitted November 20, 2017 at 10:21AM by deadcoder0904

Node's design philosophy

This is absolutely a vague topic, not looking for facts here rather for thoughts. Do you think that Node brings some unique software design principles? what/where/how?For example, I had a thought that Node encourages explicit code with low abstraction. Almost everything that happens during a web request is coded (auth, cookie parsing, validation, etc), there is less magic happening in comparison to Ruby/.NET/etc

Submitted November 20, 2017 at 09:33AM by yonatannn

How would you go about syncing data between Node.js, Electron and React Native?

Hi all.Say that I'm building a note taking app. There's a Node.js Express server exposing a REST API, a web app and both an Electron desktop app and an Android/iOS React Native app.What would you use to store and sync data between all the clients and the server? I've looked into Realm but the pricing is insane (starts at $1750/mo for the server component), Firebase but it doesn't seem to include a way to persist data for the Electron app, MongoDB but it seems that I'd need to write the whole sync logic by myself. How would you address this?Thanks!EDIT: what db engine would you use on the server, on the desktop app and in the mobile apps? As the app should work offline as well, at a high level, how would you implement sync and deal with potential conflicts?

Submitted November 20, 2017 at 08:11AM by lord_jizzus

Sunday 19 November 2017

ShuffleTube - I built this using MEAN, wanted to hear feedback about it. So guys, Let it rip....!!

http://shuffletube.in

Submitted November 20, 2017 at 04:36AM by ShuffleTube

grabity - Get preview data from a link. Just grab it! (node.js)

http://ift.tt/2zgLwWR

Submitted November 19, 2017 at 10:08PM by e-oj

User-friendly node.js server?

Hi guys, I recently made a multiplayer game that runs on node.js for the networking side of things. I'd like it to work like Minecraft where you can download the game, run the game and run your own server to play on. Ideally I'd have a UI like Minecraft servers but I just need a way to let any regular old person run my nodejs server.Thanks, Mitch

Submitted November 19, 2017 at 08:37PM by MitchTJones

Trying to get going with node-postgres

I am pretty new to javascript and node in general. Just completed a Udemy course and have just started develop my own app.I am just doing my first test, connecting to my postgres database. I am just trying to follow the documentation with a simple example. But this give me an error "TypeError: Client is not a constructor"Can someone please point out what I am misinterpret from the doc?This is the code it its essential // RequireClient = require('pg'); // Route using pgapp.get('/data', function (req, res) { const client = new Client({databaseConfig}); client.connect((err) => { if (err) { console.error('connection error', err.stack) } else { console.log('connected') } }) });

Submitted November 19, 2017 at 06:17PM by geoholic

RESTful services using TypeScript decorators, Angular’s Dependency Injection for Node.js

http://ift.tt/2mETvHz

Submitted November 19, 2017 at 04:48PM by luixaviles

Can I ship NodeJS with my software?

So I just made a program using nodeJS which would allow live file watching across your local network. Now, when I have someone downloading my software, unless they are a developer, they probably dont have node installed... and also wouldnt... So can I somehow ship nodejs with my software? Like once i saw python being shipped with the software

Submitted November 19, 2017 at 04:35PM by OhItsuMe

Domain API to be reimplemented over Async Hooks API

http://ift.tt/2zUIqoI

Submitted November 19, 2017 at 03:50PM by ecares

Mobile app api authentication

So I am busy building an API in express for a mobile app. But it is time I start thinking of authentication.I could obviously go with HTTP basic auth, but that means storing the credentials in the app itself. So if the app is decompiled, the attacker can use the API maliciously.What I was thinking is that I just expose the API user register and login routes publicly then require a token from the user login to access further routes.Anyone have any other suggestions?

Submitted November 19, 2017 at 01:29PM by thezadmin

Prospects for consulting / remote work in node.js ecosystem

I'm transitioning from working in a small company with a proprietary software product to doing web application development work from home. I don't want to relocate for a job, and local employment isn't an option. My preference would be to do full-stack node/react development, but remote contract work around PHP CMSs like Drupal seems pretty easy to find. I don't really want a full-time salaried spot with a company.Any feedback on finding / creating such a role in full-stack node/react development? Is there much outsourcing in the ecosystem?

Submitted November 19, 2017 at 10:54AM by calligraphic-io

Test npm dependencies in your automation scripts

I wrote earlier about CLI tool for checking npm dependencies and /u/cooliobing suggested to introduce CI mode.I think it'a cool idea because in real life nobody cares until build is not failing 😉Now you can add config to your package.json:"config": { "maxPackagesNumber": 100, "maxSizeBites": 840400, "allowedLicenseTypes": [ "permissive", "publicDomain", "uncategorized" ] } and then call in your build scriptnpm-consider install --test and command will exit with code=1 of limits are not satisfied.Now you know when someone added a creepy dependency to your project! Check docs if you are interested!

Submitted November 19, 2017 at 08:22AM by delfrrr

Using PM2 programatically..

Is it possible to restart my nodejs app from within the app itself, using PM2? I'm finding the odd instance where the app stops performing properly, but doesn't crash (which would see pm2 automatically restart it).

Submitted November 19, 2017 at 09:29AM by rEvolutionist3000

Saturday 18 November 2017

You-Dont-Know-Js equivalent for Node.js?

I learned JavaScript from You-Dont-Know-JS and I loved this course, it was very exhaustive, very clear and made me very confident with JavaScript.I was hoping if there exists equivalent Node.js tutorial that should be like the tutorial for JavaScript -- free, text-only (not interactive like NodeSchool's tutorial), very exhaustive that teaches from very basic to advanced level.If you know please let me know and vote this post up for others.Thanks!

Submitted November 19, 2017 at 05:46AM by rtvuser

node-prune: Pruning unnecessary files from node_modules (by tjholowaychuk)

http://ift.tt/2zeOn2J

Submitted November 19, 2017 at 04:38AM by cooliobing

How to deploy node project on the server which is using the Apache server?

I tried to use and set up the apache server and then run the API but end up getting the 404 response. What I have tried and current status can be checked here.

Submitted November 19, 2017 at 04:39AM by Ankur_3

Announcing Postverta: an Infrastructure-free Coding Platform

http://ift.tt/2zflELh

Submitted November 19, 2017 at 12:56AM by ang_li

Multiple socket.io connection for the same page?

Hey all I need some serious help ahaha.So I am trying to create a real time message app using socket.io,express and AngularJS and it has been going well. I need to emit a private message to a socket user but it never catches the"on" event (If I emit to all sockets it works). After abit of debugging I noticed that when I first launch my app there are multiple socket connections for the same page. A exmaple of the code is below://Listen on the connection for incoming sockets io.on('connection',function (socket) { console.log("New new connection has been started");From the above console log I get the following:listening on *:3000 New new connection has been startedNew new connection has been startedNew new connection has been startedNew new connection has been startedNew new connection has been startedI have no idea why this is happening! I have been trying to fix this for days with no luck, IM DESPERATE AHAHAHAH

Submitted November 19, 2017 at 01:36AM by pd145

Triggering an alarm on an apple watch with nodejs?

I have some node code that runs and I want to be alerted when it completes. I'd like for this to trigger a lot of vibrations on my apple watch. Much like the alarm clock feature on the watch.Does anyone have ideas for how I could go about this? Any pointers would be appreciated.

Submitted November 18, 2017 at 09:30PM by yourfavorite

Problem with Socket.io

Hello EverybodyI have a problem while using Socket.io to make a simple multiplayer game using the HTML Canvasright now I'm Just trying to Sync the movement onlythe problem is when the player Joins the map It works only on the with the first client, so basically when a 3rd client comes in...the first client will have 3 players and the 2nd client will have 2 players and the 3rd only one playerand the other problem is the I couldn't do the player position syncingIndex.html Codehttps://pastebin.com/AU57hKJ0Server Code http://ift.tt/2itzorj Code http://ift.tt/2ARemcY would really appreciate your support

Submitted November 18, 2017 at 04:14PM by Cangasevere

How to check if a variable is equal to any of the elements in an array?

I'm making a little project and here's my issue:const siccTraits = ["Strength", "Intelligence", "Charisma", "Cunning"];Let's say I store the user's input (which is going to be one word) into a variable x. How would I check if the variable X is equal to any of those elements in that array?if (x === whatDO) { do somethign here } PS: I know how to get the user's input and make if statements, I just don't know the other part.

Submitted November 18, 2017 at 04:25PM by Bucketlava

Friday 17 November 2017

Face Recognition with Node.js and OpenCV

http://ift.tt/2A8rFcF

Submitted November 18, 2017 at 03:01AM by justadudewhohacks

Strange TypeError when calling a function in Node.js

I have a library named lib and a function in it called getInfo. I have another library called util. A function in lib calls a function in util, which calls lib.getInfo() , and when it runs I get "TypeError: _lib2.default.getInfo is not a function". I clearly call lib.getInfo() in my file, and I am wondering why I get this error. I have unit tested getInfo using chai and it executes properly. My only thought is that I should not be calling functions back and forth like this. I tried searching on stackoverflow and google, but I am at a loss.

Submitted November 17, 2017 at 09:12PM by 302prime

What's New In Mongoose 4.13: Aggregation Middleware

http://ift.tt/2jBepGv

Submitted November 17, 2017 at 07:00PM by code_barbarian

Learn Real World Node.js Applications to Deployment

http://ift.tt/2j2IFWP

Submitted November 17, 2017 at 05:47PM by dnonsense

First time using node.js how do I install stuff? C# Dev

So i've started working on a bot for steam and walked into some problems... First of all here is my code:const SteamUser = require('steam-user'); const config = require('./config.json'); const client = new SteamUser(); const logOnOptions = { accountName: config.username, passowrd: config.password }; // username & password (steam) client.logOn(logOnOptions); client.on('loggedOn',() => { console.log('successfully logged on.'); }); I have a config file in the same folder with the name config.json and in it the code { "username" :"username", "password" :"password" } of course in the 2nd password I wrote my password and in the 2nd username the usernameI don't understand how to run it or use it. I've tried going into a cmd and type: cd (location) npm install steam-user at that point I had many warns but kept on going and typed: node bot.js didn't do nothing. I've understood I need to install steam-totp aswell but I have no clue how to install stuff a help would be appericiated

Submitted November 17, 2017 at 01:44PM by Eyal57

Node.js Weekly Update - November 17

http://ift.tt/2AWAl2P

Submitted November 17, 2017 at 01:24PM by andreapapp

Clean extract articles from websites, directly to markdown

Hi guys, this is my first post here.Just wanted to let you know about my small Node.js project, http://ift.tt/2ipBTuz extracts info from blogs and articles.It's basically inspired by "readability", but much more efficient in most cases, and the article is directly converted into a human readable markdown file.You can use it to save interesting articles offline, in some form of database. You can convert the markdown into a very clean PDF, to read on your tablet or Kindle.What do you think? I'm open to ideas and suggestions!

Submitted November 17, 2017 at 11:55AM by croqaz

Is there any way to find out the recently published npm packages?

No text found

Submitted November 17, 2017 at 12:25PM by avicoder

Node-ChakraCore update from Node.js Interactive 2017 - Microsoft Edge Dev Blog

http://ift.tt/2fMua8r

Submitted November 17, 2017 at 09:28AM by ginger-julia

Native pattern matching for Javascript is officially released!

http://ift.tt/2lfBdai

Submitted November 17, 2017 at 08:53AM by tumeni

Thursday 16 November 2017

Is Heroku still the easiest way to deploy nodejs apps

I've used Heroku in the past and it's dead simple. I'm not a dev ops guy, but I'd like to know about alternatives ...

Submitted November 17, 2017 at 05:06AM by ForSprint09

Nodejs, CSV and Cron?

I'm trying to write a node app that will read a csv file and update each row at a setinterval to a mongo database.For Example, I have a csv file with 2000 rows and I’d like each row to be updated to my db once a day.I followed this tutorial to upload a csv file to my mongodb database: http://ift.tt/2z9KVTj but all that does is update my DB with all the files that I upload and it displays immediately on my page.My goal is to have each author on the csv displayed once per day until there are no more authors.What is the best practice to have the csv file read row by row to update my collection? Or rather, display a document at a set interval?Ultimately I would like to utilize my raspberry pi to have this run automatically.Sorry if this such question has been asked before or if this is the wrong subreddit, I'm rather new to development. I've read up on cron jobs and crontabs and looked at a few videos regarding this, but beyond that, I’m kind of lost and any help would be appreciated.

Submitted November 17, 2017 at 04:15AM by BroXplode

Exit Status 1 code ELIFECYCLE?

Hey dotcomrades,I am trying to fire up a node project for the first time in a couple weeks - my OSX ran some updates in the background while I wasn't paying attention. I am now getting the below errors - project name removed and replaced with PROJ.npm ERR! Darwin 16.7.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v4.8.4 npm ERR! npm v2.15.11 npm ERR! code ELIFECYCLE npm ERR! PROJ@0.1.0 start: `supervisor --debug app.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the PROJ@0.1.0 start script 'supervisor --debug app.js'. npm ERR! This is most likely a problem with the PROJ package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! supervisor --debug app.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs PROJ npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls PROJ npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /Users/USR/Dropbox/PROJ/originlocal/npm-debug.log Yeah, I know it is an old build of node - I have to update it, but that is going to be a pain in the ass process as I am sure it will break a bunch of dependencies and it will take quite some time to sort out.Any insights?Thanks!!

Submitted November 17, 2017 at 02:51AM by libertymcateer

NVM vs. N

Hi Everyone,Is nvm the same as n? I've been using n on my development server, but I'm currently watching an older node course on pluralsight that might be a little dated, and is demonstrating nvm. What's the story here? I feel like I missed something.

Submitted November 17, 2017 at 02:54AM by boogermanus

Is there anything lke rappasoft/laravel-5-boilerplate for node?

So i stumbled on rappasoft/laravel-5-boilerplate today and it looks pretty sweet, for me about the only thing missing is the ReactJs implementation for the front end.Is there anything like this for node? maybe with more of a SPA/client side app type lean to it.you can see screenshots of the boilerplate in action here on the quick start page.

Submitted November 17, 2017 at 02:34AM by ndboost

Swagger alternatives

Hi guys!I'm a experienced developer, new in nodejs tho.i gave created 2 node microservices. one with full node.(app.get)other one with swaggeri think that swagger project sounded more professional.do all u guys use it? are there alternatives?how do u guys develop your nodejs projects?

Submitted November 16, 2017 at 09:58PM by Revlack_br

Clean node module cache and re-require?

I have a node module that automates certain build processes and instantiates some classes. I want to hook this up with a gulp.watch, but it only builds the first time. I'm assuming this is because of the way my build system caches changes, and it isn't re-instantiating the classes. Running it fresh works every time.Is there a standard way of dealing with this? Is there some kind of design paradigm I can use to avoid this situation, or am I going to have to do some trickery with the cache?

Submitted November 16, 2017 at 09:35PM by topherlicious

I've combined a Raspberry Pi, Touchscreen, NodeJS, Python, and a GPS Module to create a Raspberry Pi Dashcam and Google Map location display! I'm still working on the project, but this part is working now!

https://www.youtube.com/watch?v=gvpgCMMRBHU

Submitted November 16, 2017 at 09:16PM by Autsin

Dumb Question (please don't flame me) - Can Nodejs run on AIX?

Does nodes work on AIX (1.3)?

Submitted November 16, 2017 at 07:09PM by HuckleberryC

Here's a link to take the Node.js 2018 User Survey

http://ift.tt/2wyotSe

Submitted November 16, 2017 at 04:59PM by codedesi

Hey everyone, I made a fast-paced, mobile friendly game with Node.js. Grab your friends and start clicking like crazy!

http://ift.tt/2iZMig8

Submitted November 16, 2017 at 04:19PM by remixie

[Code Europe] IT Stars form Uber, Netflix, Microsoft, Oracle, Walt Disney, Soundcloud @ the largest programming conference in Central Eastern Europe

http://ift.tt/2hsv6Q7

Submitted November 16, 2017 at 04:19PM by CodeEurope

How to send over my app to my linux server?

Forgive me if this is something simple to do but I just couldn't find any tutorial on the topic.I basically made my app in node.js using Visual Studio CODE.I bought a VPS on digital ocean and set up my server and installed node. Now, how do I transfer my file/code I made on my desktop to the server so I can actually run it on the server?Appreciate any help here. Thanks

Submitted November 16, 2017 at 03:18PM by Bucketlava

Do you know any library capable of validating an XML against a XSD 1.1 ?

Can I use Node cron to execute a python terminal command every 3 hours?

Hi,I am trying to execute the following every 3 hours using node-cron but not having much luck. Can anyone suggest the correct way to approach this?The command is python3 path/to/my/script/script_name.py

Submitted November 16, 2017 at 11:20AM by Finrojo

Top 3 Node.js Online Courses - CodingTheSmartWay.com

http://ift.tt/2mAHd35

Submitted November 16, 2017 at 09:54AM by codingthesmartway

Wednesday 15 November 2017

Starting out with Node+Express+React - do I need another server-side templating language at all, or can I just use React?

I'm a PHP dev (been doing webdev on and off for 18 years), who so far pretty much just knows enough JS to do typical stuff with JQuery. I'm diving head on into completely switching over to Express for backend, and React for frontend over the coming year.When I create my first Express project (using express-generator), I'm given the choice of which templating language I want to to use on the backend: ejs|hbs|hjs|jade|pug|twig|vashGiven that I want to dive into using React for both client-side and server-side rendering for the most part... does it still make sense to use one of the above templating systems for the general backend site-wide layout rendering for the core stuff like global header/footer/menu, meta tags etc? ...if so, keen on opinions comparing them.Or can I ignore them altogether and do all templating in React?I know there's probably no binary right/wrong answer here, so I'm mostly after opinions... What would you recommend?Also I'm guessing that I might kind of be comparing apples to oranges here, as React mostly serves a different purpose to most templating systems, especially regarding "page rendering (this part is the core of my question)" -vs- "building interactive applications"... but I'm just wondering if there is a good enough case to use React for both purposes... or if I'm just making things harder for myself?In case it's relevant, my personal situation is that I do have quite a bit of time to learn right now, and I'm mostly going to my building my own sites, so I don't need to work with other devs. But they will be fairly large projects and I'll be continuing to build upon over the next 10 years. Some sites/pages will have complete pages rendered server-side, and some will be a mix with client-side rendering.I know there's other similar threads asking for advice on which Express templating option to pick, but I'm keen for current opinions, especially on the "can React replace them altogether?" thing.Also if you happen to have any random tips that could come in handy for an immigrant from PHP-land, please feel free to chuck them in! It feels like there's so many different frameworks etc I need to learn to just get started in this new JS/Node world.

Submitted November 16, 2017 at 05:08AM by r0ck0

Firefox Quantum NodeJS

Given that Firefox has just launched a new browser with a focus on speed, will this leak back into the nodeJs community with a different engine to the one powering nodeJS now?

Submitted November 15, 2017 at 09:51PM by andylockran

Survey: Learning Node.js in 2018

http://ift.tt/2zDpcpY

Submitted November 15, 2017 at 10:02PM by andreapapp

A boilerplate to kickstart new nodejs packages or experiences.

http://ift.tt/2AKNOK7

Submitted November 15, 2017 at 10:16PM by marcker

Beating Levenshtein with Ukkonen's algorithm

http://ift.tt/2yJl57T

Submitted November 15, 2017 at 08:37PM by sunesimonsen

Visual Studio Code keybindings JSON data + scraper source

http://ift.tt/2mtB8Fs

Submitted November 15, 2017 at 07:03PM by bjornkrols

Debugging Memory Leaks and Memory Bloats in Node.js

http://ift.tt/2yKfNcD

Submitted November 15, 2017 at 07:04PM by zoba

Building scalable real time applications with minimalistic node.js framework.

http://ift.tt/2ybO8nL

Submitted November 15, 2017 at 05:58PM by goriunovd

What can I do WITHOUT NPM mods?

There's an NPM module out there for EVERYTHING! But, I'm sure a lot of the stuff I use an NPM module to do can be done in core node if I just knew about it.Example: I just learned about node's FileSystem [require('fs')] and it's awesome and just what I needed for a recent project! I don't need to install an NPM package with support for 100+ methods when I only need 2 of them.Basically, I'm looking for articles or resources along this line of thinking..."10 Things Node can do without NPM Modules!" "You don't need an NPM Mod for that!" "Top 15 Core Node.js Features"You get it... Thanks in advance!

Submitted November 15, 2017 at 06:13PM by SableElephant

Looking for Help with PowerBI Custom Vis

Good morning!I'm trying to get a custom visualization made for PowerBI to visualize SQL Server Agent jobs. I can provide the SQL data in whatever format necessary (including the PowerBI Query results in table form for testing), and take care of the DAX required for measures.It would basically be a Gantt chart, but with recurring activities, several options for colorization, shading, grouping and visibility. X Axis would be a timeline, zoomable all the way from 9 days (week plus a day on each side) into probably a minute increment. Y axis would have a horizontal Bar for each group of data, starting with the Server, drilling into the Job Category, finally drilling to the Job Name. Each data point would be based on a starttime and expected duration for that specific job. So a job that runs every 5 minutes, for 10s would look like Start: 8am Duration 10s ; Start: 8:05am Duration 10s etc... Those would be represented on the timeline as a single bar, with colored space while running, and no color when not running. At the bottom, it would have a bar showing the timing overlap for jobs at that level of drill, letting you know where you can deconflict. It might also take into account history of the job, showing success/failure and actual duration (color code for long running jobs) - depending on how hard it is to add.From what I've read, Custom Visualizations are programmed in node.js - which I know nothing about. I'm a database guy. Is anyone willing to collaborate on an open-source, free visualization for the PowerBI and SQL community? Mods if this is the wrong place, please let me know where I could post this. Thanks!

Submitted November 15, 2017 at 05:42PM by ISUJinX

I reduced GraphQL codebase size by 40% and increased Flowtype coverage to 90%+

http://ift.tt/2AJqqwR

Submitted November 15, 2017 at 04:27PM by gajus0

List of Top 10 Node.js Frameworks for Beginner Web Developers

http://ift.tt/2htuqtG

Submitted November 15, 2017 at 03:07PM by carolina_sar

Does replicating Node process speed up perf in most cases?

http://ift.tt/2z4Mc1y

Submitted November 15, 2017 at 03:26PM by mulijordan1976

Introducing Visual Studio Live Share

http://ift.tt/2ihdgAi

Submitted November 15, 2017 at 03:32PM by ben_a_adams

JSX to C++ Virtual DOM

http://ift.tt/2jtyq1I

Submitted November 15, 2017 at 02:07PM by Teo_Basso

Handling scrypt callback

Hello,I'm currently working on implementing a passport.js-based implementation of local-authentication in my server.Unfortunately, I'm pretty new to nodejs, so I'm having troubles understanding how to properly implement the scrypt.kdf() function. I only need the result of the function, but if I did it synchronously the program would stop working for at least 3ms while it hashes the string... Which (I think?) is unacceptable.In C# I would probably do it in a new thread. I don't think that's how I should do it in node, but I'm lost with the callback.I have a user object that should be saved in mongodb. I understand how to set the rest of the properties, I'm only lost with the scrypt.kdf() async function.Should I do it with promises?

Submitted November 15, 2017 at 10:55AM by SixLiabilities

Remote Code Execution in CouchDB (and Privilege Escalation in the npm Registry)

http://ift.tt/2hqXIcm

Submitted November 15, 2017 at 11:58AM by nullvariant

Mocking is a Code Smell

http://ift.tt/2yE868D

Submitted November 15, 2017 at 11:18AM by fagnerbrack

Microservices with Docker, Flask, and React

http://ift.tt/2zEqLUB

Submitted November 15, 2017 at 09:54AM by krylovanatu

Wiring up a GraphQL server with Node and Express

http://ift.tt/2zswRUY

Submitted November 15, 2017 at 09:03AM by dobkin-1970

Tuesday 14 November 2017

"Are you tired of YouTube breaking your plugins?"(My First Node.JS/Electron App)

http://ift.tt/2zYJf2y

Submitted November 15, 2017 at 01:42AM by hsoj95

Finding Latitude / Longitude values of an address: Alternatives to Google Maps API?

Hey guys, quick question for anyone who is experienced in this realm: are there any good open-source ways of finding coordinates for a particular address or city or intersection? I can do it using it Google Maps API of course, but they're crazy expensive and I can't afford it for my early start-up project.Any help would be MUCH appreciated!

Submitted November 15, 2017 at 12:21AM by snahrvar

Node v9.2.0 (Current)

http://ift.tt/2jrdKY0

Submitted November 14, 2017 at 11:17PM by dwaxe

Object key mirror helps you create objects with values equal to its key names.

http://ift.tt/2iVvVkL

Submitted November 14, 2017 at 10:05PM by temilaj

How do I create Microsvercies in Node?

I've been looking into employing singular, seperately scalable, Microservices with my current project I'm writing a server for. I intend to add new apps later down the line; meaning more endpoints, maybe more seperate services.One question: how exactly do I create a microservice in Node.js? I've considered child processes with individual Express apps, but then come across the port-sharing problem (actuallly had to give up on this after many roadblocks today). I'm also currently considering writing several little apps that talk through REST, but that also means dealing with different ports in some way or another.

Submitted November 14, 2017 at 08:34PM by Crowesco

Ionic Socket Chat

http://ift.tt/2zXj78l

Submitted November 14, 2017 at 08:48PM by WideAsleepDad

Run a free and easy to use website for your upcoming events using node.js

http://ift.tt/2zKazyN

Submitted November 14, 2017 at 09:12PM by klaasklaar

Node.js 8.9 Released with Long Term Support

http://ift.tt/2ibA9oA

Submitted November 14, 2017 at 04:32PM by M-jlstc

How we build real-time features using NodeJS and SocketIO

http://ift.tt/2moS7ZC

Submitted November 14, 2017 at 04:41PM by Emielean

Magic configuration in Node.js using module preloading

http://ift.tt/2yCdzvO

Submitted November 14, 2017 at 03:37PM by kiernanmcgowan

A twitter bot to help you learn regex

http://ift.tt/2ienbGY

Submitted November 14, 2017 at 03:21PM by bjornkrols

/r/node can you participate in my research survey?

Hi /r/node! I'm currently performing data collection for my MBA dissertation. I'm keen on getting your feedback on your experience with software development velocity & agility. If your current role is part of a software development ecosystem, I would like to hear from you and learn from your experience.Would you be able to participate in a quick survey? It should take no more than 10 minutes. Thanks :)http://ift.tt/2jqBWtI

Submitted November 14, 2017 at 02:23PM by kiawin

Swagger nirvana

The road to smooth swagger integration in a typical dev flow seems long: (a) there are tools that will convert swagger spec into API - I want to write my own API for fine grain control (b) other tools demands routes annotations to generate swagger - forces me to define all my models twice (50 lines of code above each route)Looking for a tool/technique that will (a) generate the swagger based on my models (defined in JSON schema or JOI) OR (b) generate API based on a swagger file but let me override the code generation or provide some runtime hook so my code takes the lead once the endpoint is invokedTalk to me u community of smart people

Submitted November 14, 2017 at 10:30AM by yonatannn

List of Top 10 Node.js Frameworks for Beginner Web Developers

http://ift.tt/2ieWWQo

Submitted November 14, 2017 at 10:19AM by rinkidhiman

Node.js Top 10 - Nov 2017

http://ift.tt/2jqd2u8

Submitted November 14, 2017 at 10:15AM by itsawesomeday

[SLIDES] How to Build a Resilient API Design with REST and an API Gateway

http://ift.tt/2zWQvw8

Submitted November 14, 2017 at 07:44AM by robotixs

Monday 13 November 2017

My friend works for Nike and finally got approval to Open Source his pet project that he's been working on in his free time. Its an alternative to Nightwatch/Selenium made with pure JS named Burnside. Check it out!

http://ift.tt/2m0GOX7

Submitted November 14, 2017 at 06:19AM by SparserLogic

How can I do an array of requests using request promise and then wait for all to finish .

Doing a bit of fun late night coding{code}let rp = require('request-promise-native');rp(url).then(function (htmlString, body) { let jsonP = (JSON.parse(htmlString) // then do another dozen requests here, and at the end of them all continue{code}

Submitted November 14, 2017 at 06:46AM by ForSprint09

Native HTTP/2 in Node Core

http://ift.tt/2jqHtAh

Submitted November 14, 2017 at 05:59AM by treyhuffine

I want to "containerize" my node app for easy deployment to multiple clients but I have a config file that will be different per deployment. How do I handle this?

Essentially, I want to "containerize" or "dockerize" a web app for easy deployment on multiple servers for multiple clients. However, I have a config file with credentials that will need to be changed/updated for each client. How could I achieve this?

Submitted November 14, 2017 at 02:45AM by ribbet

What's the best way to learn node online WITH a mentor/tutor/community to whom you can constantly ask questions?

Hi guys, I want to learn node. I'm embarking on my programming journey and just got some basics from finishing Harvard's CS50 with C, Python, Javascript.It's an online course where there was no mentor/tutor that I could constantly bombard questions to (however silly ones). So, it took quite a long time to finish.A mentor/tutor would allow me to spot problems/explain what I don't understand in a much more time-efficient manner.The reason I find it important is because I have a full time job, where I travel between countries and can't commit to a face-to-face course, because I simply won't be there half of the time.I'm based in Europe, so some courses that offer online support/video sessions don't work very well with timezones, because if they're done in the evening, it's night time over here.A paid solution is completely fine, as long as it's not astronomical... Would be really grateful for your suggestions, thanks!P.S. Currently reading Eloquent Javascript, and doing some codeacademy courses.

Submitted November 13, 2017 at 10:05PM by rokasj

State container library - Politic (Redux alternative) (Crosspost r/javascript)

http://ift.tt/2zUjele

Submitted November 13, 2017 at 10:23PM by BlueJeansAndRain

Browser automation revisited - meet Puppeteer

http://ift.tt/2jmWoLY

Submitted November 13, 2017 at 07:48PM by gorgerson

Can we talk about hot failover to a second machine?

I've been required to add redundancy to one of my installations. Basically, an entire second Linux machine sitting there waiting for the first one to fail.My project has a bunch of data collecting node processes all talking to other networked devices and writing to a local mongo database. Since I have a could-based supervisor, that now gives me 3 nodes, so I can replicate mongo data fairly easily.So, what sort of tool or mechanism should I use to figure out when to tell the secondary server to start all the node processes, after noticing the primary has failed.I could write my own scripts, and use pm2 to start and stop things, but I was wondering if this problem has already been solved, by things like Heartbeat, or some clever npm package that I can't seem to successfully google for.

Submitted November 13, 2017 at 06:37PM by mainstreetmark

Anything new for security best practices in 2017 for express?

Currently creating a new boiler-plate with express to help start projects. For the security side of things, is everyone using Helmut and/or Lusca? Lusca seems to be the better option as it has more features.Am I missing anything?SSL/TLS using NGINX as proxy severLusca for CSRF, XSS, clickjacking and a bunch of other thingsPassport for logins.User-access - still not sure what to use here. Previously I always used sessions and cookies.Anything else? Doesn't seem like much has changed over the past few years.Thanks!

Submitted November 13, 2017 at 05:17PM by dangerzone2

Serving React (sub) app on a specific route with Express

Well, I was wondering what's the best way to manage sub apps with express? For example, I'm trying to make a web application / site with administration panel and I wanted a panel to be a completely independent app (with it's client side framework like react, libraries, static files and so on) from which I'll be able to control main app (app that's being serverd on root route). Root route app has nothing to with react and stuff.So I was thinking about creating a route for my panel app, something like /panel or /admin and serving a react app on that route. Problem is I don't know how to do it properly, I mean I started something but I wanna be sure in the start that I am doing the right thing.EDIT: (well, that was quick)I found something like this on a blog. I think it suits my needs.var express = require("express"); // sub-apps var sub1 = express(); sub1.get("/", function(req, res){ res.json({status: "SUCCESS!!!!!!"}); }); var sub2 = express(); sub2.get("/", function(req, res){ res.json({ foo: "bar", baz: "quux" }); }); // main app var app = express(); app.use("/foo", sub2); app.use("/", sub1);

Submitted November 13, 2017 at 04:28PM by srdjus

Alternative to Loggly

We have been shipping our logs using Bunyan and Loggly and I was wondering if anyone had a better experience with another logging service. The interface for Loggly is clunky and I find the filtering difficult to use. Does anyone have suggestions for nodeJS specific logging? We don't really need it to be system/language agnostic, we just need something that has a simpler interface and a better query language(NOT Apache Lucene)

Submitted November 13, 2017 at 02:21PM by maxwellsmart84

Automated UI testing with Nightmare

http://ift.tt/2hu5xl8

Submitted November 13, 2017 at 01:57PM by zomgitsrinzler

Full Stack Node.js Development Services

http://ift.tt/2htNDPs

Submitted November 13, 2017 at 11:24AM by LiamJames03

Assert or not?

Can someone please explain to me the benefits of Node's assert module (or on a lesser note, Tape's)? Why would I use assert when I can just use a simple if/try wrapped in a function? It feels like it doesn't really do much.

Submitted November 13, 2017 at 11:59AM by bertong_uto

How to perform some synchronous stuff

I learned that a big part of node is asynchronous. Are there ways to handle things synchronously? For example, can we wait until a database request is complete and then do something else? Like, store the result in a variable?In some cases, the object/array returned by the database result is not how I want it and so I have to build an object according to my preference. In other cases, where a loop is involved and inside the loop, there is async happening and unable to store the data returned outside of the loop.1st example.app.get('/dbstuff', function(req, resp) { var results = []; connection.connect(function(err) { db.query('SELECT * FROM employee', function(err, result) { for (let item of result.recordset) { results.push(item); // don't ask me why I would do this, I just want to know if it's possible } }); } console.log(results); // undefined }); 2nd examplesomeModule.emloyees(err, employees) { // a module that gets all employees var empId = [1, 4, 6]; // the employees I want to return var emp = {}; for (let employee of employees) { if (empId.indexOf(employee.id) >= 0) { someModule.employee(employee.id).get('name', 'department', function(err, emp) { // this is happening async emp['name'] = emp.fields.name; emp['dept'] = emp.fields.department; }); } // sadly, I cannot resp.send here so I have to build my obj } console.log(emp); // but it's undefined }); This would be useful for those who are also learning node.

Submitted November 13, 2017 at 10:52AM by eggtart_prince

Electron User authentication

I am developing an app that so fat features a window with a login and signup form, rendered in an electron window. On submitting, all the user is gathered(email, password, name etc) How will someone try and authenticate this user? My main idea will be to have a server and a database. This server implements REST API. On submitting, the data will be sent to a route, via a POST request, for example http://localhost:8000/signup, and the server will comapre this data with the data base. My question is how can I validate this data? What is the best approach? Should I validate the data in the electron window, then send it to the server, or should I send the data directly, and let the server handle the validation. I want to do this the best possible way, and elegantly. Has anyone developed a user signup/ login form, and can give me some advice? Thank you.

Submitted November 13, 2017 at 09:38AM by justplayit94

Getting started with React 16 – Arun Michael Dsouza – Medium

http://ift.tt/2ACV3Vo

Submitted November 13, 2017 at 09:00AM by amdsouza92

Should I be having unauthorized read access on a database?

Hello there!I started to look at an eCommerce Website, and I noticed that I have read access to their Firebase Database via their key, which they have unencrypted in their [something].js file.Is that supposed to be intended? Shouldn't it be any form of authentication preventing anyone to read their database?Cheers, Francesco

Submitted November 13, 2017 at 09:01AM by DrSghe

Sunday 12 November 2017

How to check if a Reddit Access Token is valid with NodeJS?

I am making an NPM module for the Reddit API. client.authenticate('my access token'); How am I able to test if my access token is a valid Access Token? Is there something I can fetch with their token that tells me?This is how my code is set up currently:class Client { constructor(options = {}) { this.clientId = options.clientId; this.clientSecret = options.clientSecret; } authorize(token) { return new Promise((resolve, reject) => { // if access token is valid, resolve with the token // if access token is invalid reject(new Error('You provided an invalid token.')); }); } } Furthermore, I'd like methods I make to only be available if the user has authenticated (they have that one line of code and token is correct).

Submitted November 12, 2017 at 11:54PM by Rusty_TV

How to handle forms with Express?

Hi, I'm a newbie at Web Dev, and I wanted to make a dropdown menu, to select a specific number, and when the user press the submit button, it goes to another page and shows the number selected. Can someone help me?

Submitted November 12, 2017 at 11:35PM by gabrieldi95

Trying to use .js in HTML...

Hey, I have the following code, where I want to use main.js(it uses node.js) in my .html.main.jsconst http = require('http'); const fs = require('fs'); const readline = require('readline'); var server = http.createServer( (req, res) => { res.writeHead(200, {'Content-Type': 'text/html'}); fs.createReadStream(__dirname + '/index.html').pipe(res); }).listen(3000, '127.0.0.1'); console.log('Server started...') function readStream() { var stream = fs.createReadStream('C:/Users/Mat/Desktop/readMe.txt', 'utf8'); var rl = readline.createInterface({ input: stream }).on('line', line => { console.log(line); }); } index.html For some reason, the function readStream() is always undefined. Why is that? Both files are located in the same folder.Thanks!

Submitted November 12, 2017 at 07:26PM by Fasyx

HTTP/2 in Node.js core

http://ift.tt/2jlfXE8

Submitted November 12, 2017 at 05:45PM by harlampi

Loading data into header partial in Express and Pug

Hello guys, so this is the situation:I have a navigation partial in where I want to load menu with items which I want to fetch from database.But I realized that I will have to query database for every route and pass nav points to the navigation partial (res.render("view", {..., ...., navPoints: thingThatCameFromDB})), duplicating that call in every route.How should I handle this? When I think of this problem I come to conclusion that I will have to query DB every time to get those navigation points, but where should I do this call, in every route controller where I need site navigation (because there is admin part of the site where I do not want navigation to appear)?

Submitted November 12, 2017 at 03:57PM by nikola1970

[RFC] Node.js Early disclosure program

http://ift.tt/2zF0jIa

Submitted November 12, 2017 at 01:21PM by ecares

Enzyme with Puppeteer

Hey all, has anyone used Enzyme with Chrome's puppeteer to do browser tests?I'm trying to test a React component with access to DOM apis such as window.matchMedia, but I'm having a hell of a time just getting access to the window / document object and their properties. Has anyone attempted this who can point me in the right direction?I think step one is assigning global.window and global.document correctly so Enzyme will let me mount a component.

Submitted November 12, 2017 at 12:18PM by ajc820

Saturday 11 November 2017

MERN or MEN stack?

I’m fairly new to Node and I️ love it. I️ am creating a project maybe deploying it (not sure yet), but I’m stuck with what stack to use? Is Mongo, Express, & Node a good scalable stack? Why is everyone using React? Is it just because it so trendy? Is MEN stack a good one to build a web application I️ plan to deploy one day? I️ plan to use express-handlebars for my template engine.My application is fairly simple. Authenticate users, all user to store data, and edit data.Any advice would be very appreciated. Thanks :D

Submitted November 11, 2017 at 09:08PM by elmagico94

Node.js MVC framework Performance

http://ift.tt/2htTOmG

Submitted November 11, 2017 at 08:23PM by cirospaciari

Help me with a school project

Hi, I have to do a school project using Codelite in node.js and I have no clue as to how. Could somebody help me, please? I have to make a helloworld code, a multiplication table up to 10 of a number "n" introduced by keyboard and a dice game(which I will try to do it myself). I want these codes to implement them in my project. I honestly have no idea where to even start.If anybody could explain to me how the program (and code for these things) works that would be fantastic.Sorry about my english, it is not my first language. Thank you

Submitted November 11, 2017 at 07:27PM by SassyDay

Express app with multiple Passport Auth strategies

I’m building an app with Node, Express and React. I’m planning on using multiple PassportJS strategies, Facebook, Google and Twitter. Is it common practice to ‘join’ or ‘link’ accounts? My concern is that a user may login via Facebook, then login via Twitter and they’d be classed as two separate users, whereas I’d ideally link their social media accounts together. Is this a common practice?

Submitted November 11, 2017 at 07:33PM by tomhanson

Fuse.js : How to return an exact match when there are two words to search for?

http://ift.tt/2zDGq4e

Submitted November 11, 2017 at 06:52PM by laraveling

ExpressJS - React app only in one route

Hello guys.So what I am trying to do is to have a fronted generated with pug templates but when I hit /admin route I want to start a React SPA on just this specific route but I am getting all kind of weird things and have no clue what is a correct path to do this.I assume it is not working as I cannot mix react router and express router as I am hitting "/admin" express route and want React to be show there.How should I approach to this? Thanks :)

Submitted November 11, 2017 at 05:17PM by nikola1970

Running node rest and apache front on same server

Hi I've got a question, i've been trying to figure this out for VERY long now.For a client, I'm running a front end on an apache server, but for the api calls, like the post, get, database queries etc. I'm using a node back-end.I cant get them both to work together.Anybody knows how to get this done?

Submitted November 11, 2017 at 03:57PM by AllSuitedUpJR

Port Help? Newbie Programmer

Hey newbie JavaScript programmer here! Anyways, I was following along with Daniel Shiffman's websockets, p5.js tutorial, when I came across a problem where my canvas wouldn't show and where I wouldn't be able to send data to my server. There was also the following error that came from the front side:Uncaught ReferenceError: process is not definedWhich came from:socket = io.connect(process.env.PORT || 3000);Also I posted this mini project to heroku in case you guys want a better look: http://ift.tt/2i3uD7J (inspect element, go into sources, then open up sketch.js to see the error)Here's the server.js code:var express = require('express'); var app = express(); var server = app.listen(process.env.PORT || 3000); app.use(express.static('public')); console.log('Server running'); var socket = require('socket.io'); var io = socket(server); io.sockets.on('connection', newConnection); function newConnection(socket){ socket.on('mouse', mouseMsg); function mouseMsg(data){ socket.broadcast.emit('mouse', data); } } Any ideas on what I should do to make this thing work on heroku? (This app worked perfectly fine on localhost when I didn't have the 'process.env.PORT' there and just had my ip followed by the 3000 port.)

Submitted November 11, 2017 at 11:37AM by Eriod

Friday 10 November 2017

Node.js Performance and Highly Scalable Micro-Services - Chris Bailey, IBM

https://www.youtube.com/watch?v=Fbhhc4jtGW4

Submitted November 11, 2017 at 06:18AM by ms-maria-ma

How to Verify an Email Address Using Node.js

http://ift.tt/2mf0jeE

Submitted November 11, 2017 at 05:08AM by rdegges

Whats the fastest scraper? With benchmarks please

No text found

Submitted November 10, 2017 at 11:15PM by unr3al011

How to install node 9.x on Mac using homebrew?

Currently I am only able to get 8.x.brew update brew doctor brew upgrade node Updating Homebrew... node 8.9.1 brew search node [no node@9] brew install node@9 Error: No available formula with the name "node@9"

Submitted November 10, 2017 at 07:06PM by just_tech_stuff

Node.js Weekly Update - November 10

http://ift.tt/2i2kfNi

Submitted November 10, 2017 at 04:24PM by andreapapp

uenv - zero dependency fast get() configuration manager

http://ift.tt/2zKBJbr

Submitted November 10, 2017 at 01:28PM by oiirme

Clustering with WebSockets?

I'm relatively experienced with js, but just wanted an idea on best practices with websockets using clusters in js. Should I just do the usual code here for clustering it, or on every connection, should I assign a child to handle messages from that connection. I'm currently using ws for my library and am not intrested in any of the libraries like SocketCluster etc.Thanks!

Submitted November 10, 2017 at 08:01AM by randomhippie123

Thursday 9 November 2017

FinTech APIs: An engineering panel discussion

http://ift.tt/2ma3QLf

Submitted November 10, 2017 at 05:00AM by pistolanow

All You Need To Know About CSS-in-JS

http://ift.tt/2iHS6dX

Submitted November 09, 2017 at 10:56PM by thickoat

What to do when you have a vital PR but sole maintainer is avoiding the project?

http://ift.tt/2hjlVl3

Submitted November 09, 2017 at 10:16PM by tonechild

Service prompt focus

Hello.I’m a DevOps at my company and the development team is going to start working with some Nodejs modules. The option to start their node service is with:serve -s packages/app/build --port $port I’m trying to automate that process, but for some reason at the end of it, it requires an Enter as input, otherwise it won’t give focus back to the prompt. That is messing with my automation efforts, as my boot scripts will never move past that part.Do you know why this is? Do you have any alternatives? Apologies if this looks like piece of cake for some of you, but I’m new to this environment and the developers also don’t seem to know why.Thanks in advance!

Submitted November 09, 2017 at 09:32PM by KaOSoFt

BootMe - Task Automation toolkit

http://ift.tt/2hguKfm

Submitted November 09, 2017 at 08:16PM by StarpTech

The State of Node.js Security in 2017 - NodeSource

http://ift.tt/2jg5gTH

Submitted November 09, 2017 at 08:18PM by _bit

What's New In Mongoose 4.13: Dynamic Refs and Fields for Virtual Populate

http://ift.tt/2hXsmL1

Submitted November 09, 2017 at 06:36PM by code_barbarian

Need help assembling Full-stack Node.JS kit.

Hello, I need to assemble a Full-stack kit/bundle. I have few previous projects with Node but the were mostly MVC so I used just Express.The thing I need is a solid framework but I can't choose. MEAN and MERN stacks look nice, but so does frameworks like Feathers, Meteor, Total, Ember, Sails and many more.Previously I used PHP with Laravel and it got the job done with things like:User auth with ACLModel RevisionsORM / Schema / Migrations (for SQL dbs only)CronjobsMaybe there are other things, but simply can't notice them.However I can't really decide without trying every single one of the options so I'd rather rely on your opinions. Thanks.

Submitted November 09, 2017 at 06:03PM by Vortelf

Reformatting your code base using prettier or eslint without destroying git history

http://ift.tt/2Aom7Xt

Submitted November 09, 2017 at 04:59PM by iWantedMVMOT

Why isn't my async.forEachOf TIMEOUT functioning properly??

I'm a terrible programmer and another poster here helped me create this async...But, the timeout doesn't work! It still fires all the API calls off immediately.... HELP!!Should be an easy fix... for YOU... but... not for me!!!!async.forEachOf(array, (url, key, cbURLs) => {app.models.predict("c0c0ac362b03416da06ab3fa36fb58e3", url).then(function(response) {console.log(JSON.stringify(response)); }, function(err) { console.error(err); } );setTimeout(() => {cbURLs();}, 150000000000000 + (1500* key));}, (err) => { if(err) console.log(err);});

Submitted November 09, 2017 at 04:33PM by PostNationalism

Node security do you even care? I feel like I’m living in a PHP-induced nightmare

http://ift.tt/2hmP3eu

Submitted November 09, 2017 at 03:25PM by ecares

NPM TIPS & SCRIPTS!

http://ift.tt/2hbVKMQ

Submitted November 09, 2017 at 02:13PM by webkid

Integration tests with Testcafe on Gitlab.com

http://ift.tt/2hWiFwt

Submitted November 09, 2017 at 08:39AM by krylovanatu

Wednesday 8 November 2017

Flight rules for git

http://ift.tt/1rY1OYA

Submitted November 09, 2017 at 05:12AM by ratancs

Minimalistic Node.js Framework to build scalable real-time applications fast.

http://ift.tt/2ybO8nL

Submitted November 09, 2017 at 04:32AM by goriunovd

Introducing MagiCLI: Automagically generates a command-line interface (CLI) for any module

http://ift.tt/2japVbr

Submitted November 09, 2017 at 04:27AM by DiegoZoracKy

Help! Mysterious read stream behaviour sync vs async.

Hello. I have been playing with implementing my own readable streams recently, usually for reading an API until some condition is met or the like.My problem is that I seem to have stumbled on two different behaviours depending on whether the _read() method is synchronous and async.In the docs it says: When readable._read() is called, if data is available from the resource, the implementation should begin pushing that data into the read queue using the this.push(dataChunk) method. _read() should continue reading from the resource and pushing data until readable.push() returns false. Only when _read() is called again after it has stopped should it resume pushing additional data onto the queue.Note: Once the readable._read() method has been called, it will not be called again until the readable.push() method is called.Which makes me think we should push data until the buffer is full. with is a synchronous implementation this seems to work fine.Suppose we implement a non stop stream of integers. (I wont include the whole class boilerplate just the _read implementations)// this.i equals 0_read() { let ok = true; while(ok) { ok = this.push(this.i); this.i += 1; } } Then this would work as expected. The control flow stays inside the while loop. However suppose we were getting these numbers asynchronously,_read() { Promise.resolve() .then(() => { let ok = true; while(ok) { this.push(this.i); this.i += 1; } }); } as soon as this.push is called the another _read() is called and another promise is created before we even increment our this.i Even worse, suppose there was an initial push..._read() { this.push('first'); Promise.resolve() .then(() => this.push('second')); } "second" will never be pushed. This is understandable if you assume the this.push itself call an internal this._read()... However that is not what is happening in the synchronous version, the function will end before a new one is called.In the end the rule I have made for myself to get reliable asynchronous read streams is to only allow one push per _read() and make that push the last operation of that read. if there are any state changes to make do it before pushing, or better yet abstract state away inside a closure like inside a generator.However this behaviour seems a little erratic, and if anyone who understands stream internals can explain this away I will be very thankful. Thanks.(ps. I know this are not real world examples, but only there to demonstrate control flow, or for anyone who wants to try)

Submitted November 09, 2017 at 02:39AM by davidmdm

Iterating through array but executing an async function on each element and only continuing onto the next element once the async function is complete on the previous one

How do I do that exactly...Basically, I have an arrayI want to iterate through the array and execute an asynchronous function on each elementBut the async function must resolve for each element before going onto the next element

Submitted November 09, 2017 at 02:36AM by PlasmaTicks

Help me with error in npm?

Everytime I try to run 'express' I get this error:/usr/lib/nodejs/express-generator/bin/express:62 program.confirm('destination is not empty, continue? ', function(ok){ ^ TypeError: program.confirm is not a function at /usr/lib/nodejs/express-generator/bin/express:62:15 at /usr/lib/nodejs/express-generator/bin/express:220:5 at FSReqWrap.oncomplete (fs.js:123:15) Using Ubuntu 17.10

Submitted November 08, 2017 at 11:09PM by gabrieldi95

Tweet Counter - Chrome extension to bring back the tweet character counter

http://ift.tt/2ArsPwF

Submitted November 08, 2017 at 09:52PM by kamranahmed_se

How do you manage npm tokens?

We have a private npm repository, hosted on npmjs.com. In order for CI users to install npm dependencies from our private repo, they need to have access to an npm token.You can create a new token by running npm login, and then checking your .npmrc file. But how do you manage all the tokens you've created? I don't see any way to associate a token with an application/user.And if I create tokens with my personal account credentials, what happens if I leave the company? Or say npm discloses some security leak, and we want to recreate all our tokens? How do we manage this?Also, it looks like if a user changes their account password, all their npm tokens are wiped clean.It seems like it would make more sense to have the CI user login to npm o every build, so we don't need to hardcode the tokens. But I don't see any non-interactive way to login.

Submitted November 08, 2017 at 06:05PM by edanschwartz

Any good tutorials for sequelize v4?

Please post links if so! Thanks :)

Submitted November 08, 2017 at 05:07PM by djslakor

Serverless: Moderate fun with Modular Functions – fast function routing with middleware support, on AWS and Google Cloud

http://ift.tt/2yhVIKi

Submitted November 08, 2017 at 02:53PM by fptavares

npm ERR! Please try running this command again as root/Administrator.

I'm getting an "npm ERR! Please try running this command again as root/Administrator" error when trying to install Angular CLI tools.The strange thing is if I keep running the command, after about 4 attempts it will work....? I've tried a number of things including -Running CMD as adminPowershell as adminGit Bash (my normal shell I always use)npm cache cleannpm cache clean --forcenpm cache verifyUninstalling node and re installingChanging permission settings on AppData/Roaming/npmDeleting files in AppData/Roaming/npm/nodemodulesThe exact command ran in node is -npm install -g @angular/cliThis is my current install -Angular CLI: 1.5.0Node: 8.9.0OS: win32 x64Angular: 5.0.0Thanks

Submitted November 08, 2017 at 01:45PM by franchyze922

Catching without Awaiting

http://ift.tt/2AgdT3A

Submitted November 08, 2017 at 11:55AM by xenopticon

Building a Twitter Politician Bot with Markov Chains, Node.js and StdLib

http://ift.tt/2zrisJb

Submitted November 08, 2017 at 09:43AM by keithwhor

Tuesday 7 November 2017

heroku nodejs build error after installing modules

Heroku rejected the Parse Server app buildI'm struggling to successfully execute a build on Heroku for my Parse Server. The app works locally, In past, it was working well on Heroku. But recently, Heroku is giving errors for new pushes by rejecting it.See here: http://ift.tt/2m24udQ

Submitted November 08, 2017 at 01:54AM by reddittedf

Node v8.9.1 (LTS)

http://ift.tt/2m34Bpq

Submitted November 07, 2017 at 11:09PM by dwaxe

Sequelize help needed

Hi! I'm new to Sequelize, and I am trying to join a table on a subquery, but I don't know how to express it using Sequelize ORM. This is the raw SQL I want to run:SELECT * FROM table_a a LEFT OUTER JOIN (SELECT * FROM table_b b WHERE col = VAL) ON a.id = b.id;I triedA.findAll({include: [ { model: B, where: { col: val }, } ] }).then(...);but that doesn't get me the query I want. Instead it changes the join to an INNER JOIN, and joins on col = VALUE instead of inside a subquery. Is there a way to do a join on the result of a subquery? I am using Postgres if it matters.

Submitted November 07, 2017 at 10:22PM by andynaguyen

How do I put this API call in an 'async.each'?

I'm complete shit at NodeJS. A noob. I've been using RapidMiner for API calls but it's even more frustrating....Can you wrap this in async.each properly for me? It's for my master's thesis on media bias! Just connect the input array urls to the source: in rapid.call !!var array = fs.readFileSync('Kairos.js', 'utf8').toString().split("\n");> async.each (array, rapid.call ?!?!, console.log ??!?!) {setTimeout(function() {rapid.call('KairosAPI', 'createEmotionalAnalysis', {'source': array[i], }).on('success', (payload)=>{ console.log(array[i]); console.log(JSON.stringify(payload)); return; }).on('error', (payload)=>{ console.log(array[i]); console.log(JSON.stringify(payload)); return; }); }, 1500 * i) // With each iteration, the delay increases}If you wrap it correctly once I can re-use it on tons of apis... ~~ <3333 plzzzzz help1! Bonus points if you fix it so the URLs or iteration are returned alongside the stringify(payload) ~~ Whoever helps i'll give you 100k karma, promise!~

Submitted November 07, 2017 at 08:22PM by PostNationalism