Wednesday 31 May 2017

Pusher-client latency check

How can I see what latency my socket connection has? I was reading stuff about ping and pong messages, and that they are used to keep connections alive, but have no idea how to use them.Googling for it also didn't help, would be nice if somebody can help me here :)And the reason why I need this: I am trying to buy something as fast as possible, and need to optimize the location where my program is hosted at, because I don't see any other bottleneckt that would slow it down.

Submitted June 01, 2017 at 02:42AM by cephii2

Despite performance gains, Yarn still superior to npm.

https://twitter.com/greygatch/status/870024113632542726

Submitted May 31, 2017 at 10:25PM by greygatch

Why I think V8 switched to Ignition+TurboFan

http://ift.tt/2qGsH6y

Submitted May 31, 2017 at 07:29PM by a0viedo

Blog: Using Zone.js in NodeJS APIs for logging!

https://twitter.com/amcdnl/status/869959404518592513

Submitted May 31, 2017 at 05:56PM by amcdnl

Locotro

http://ift.tt/2rp5QQX

Submitted May 31, 2017 at 06:24PM by Michael2806

MongoDB connection pooling for Express applications

http://ift.tt/2rJcY8e

Submitted May 31, 2017 at 06:27PM by jackweirdy

Node reconnection issues

In my web app I'm using socket.disconnect() and then reconnecting later in the program. A simplified version of what I'm doing is this:var socket = io.connect('localhost:3299') // code socket.disconnect() while (condition) { socket.socket.reconnect() // the two sockets is intentional // more code socket.disconnect() } My issue is that when the socket reconnects, it sends duplicate updates - so when the loop has run 1 time the socket sends 1 message when I use socket.emit(), 2 times it sends 2 messages, etc etc. Anyone know what's going on here?

Submitted May 31, 2017 at 03:26PM by J354

Last Week in Node.js Working Groups - May 22, 2017

http://ift.tt/2r8ZHYH

Submitted May 31, 2017 at 02:37PM by _bit

Node.js 8: Big Improvements for the Debugging and Native Module Ecosystem

http://ift.tt/2rnW29O

Submitted May 31, 2017 at 02:38PM by _bit

Keeping passwords safe in 2017 - JSConf EU 2017

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

Submitted May 31, 2017 at 02:04PM by emilbayes

Parse csv and insert into mysql with Sequelize

Hi,I'm trying to parse a csv file and then insert the data into mysql with sequelize. Code below: var fs = require('fs'); var csv = require('csv'); var Device = require('./models').Device var input = fs.createReadStream('./csv/test.csv'); var parser = csv.parse({ delimiter: ',', columns: true }) var transform = csv.transform(function(row) { var resultObj = { model_name: row['Model Name'], imei: row['IMEI#'], serial_number: row['S/N #'], meid: row['MEID#'], esn: row['ESN#'], mac_address: row['MAC#'], exfactory_date: row['Ex-Factory date'], po_number: row['PO#'], packaging_number: row['CN#'] , sw_version: row['Software version'], fw_version: row['Hardware version'], hw_version: row['S/N #'].slice(2, 4) } Device.create({resultObj}) .then(function() { console.log('Record created') }) .catch(function(err) { console.log('Error encountered: ' + err) }) }) input.pipe(parser).pipe(transform) After running this code, new rows are inserted into the db, but they are all 'null'. I can't quite figure out why - can someone explain to me please?

Submitted May 31, 2017 at 01:05PM by raccoonranger73

NodeJS Passport login script with MySQL database

http://ift.tt/2rDZb6f

Submitted May 31, 2017 at 11:56AM by Vasikos

Can you recommend cheap (or free!) hosting for a personal node app which does a lot of web scraping?

Hi. I am planning a personal app / showcase which is basically a souped up RSS reader. I am looking for the cheapest possible way to host it (free would be great). I'd want to use Express / Postresql but I am flexible on architecture / stack, as long as it's node based and not too obscure (not keen on Meteor). What hosting solution do you recommend?Requirementsonly accessed 20/50 times a daymust be able to run cron jobs to scrape web pages, say about 100 per hourthe same cron jobs should allow me to render pages server sidewith time the data stored may get hefty (I am OK with saving processed data to files and use the DB for metadata only, if it helps)https and password protectionThanks in advance

Submitted May 31, 2017 at 11:57AM by gotofritz

How can I achieve this?

So I have 100+ pages and basically, they're all the same layout but the data is different. Using one html file...// layout.html
If users visit the url /apple, then the name, type, and color would be associate to apple.Is there a templating engine that does this? I look through most of them and can't figure out how to achieve this.

Submitted May 31, 2017 at 10:00AM by eggtart_prince

Are stored procedures bad practice now?

My first project using nodejs, still using mysql db with bookshelf.js ORM.From reading online, I am under the impression stored procedures are now considered bad practice? What are the pros/cons of using stored procedures instead of building the query inside bookshelf?Thanks

Submitted May 31, 2017 at 10:11AM by Starchand

Anyone familiar with Mustache templating?

Is there a way to store my views in an external file so that I don't cloud up my codes with an object with a huge list of properties?

Submitted May 31, 2017 at 10:18AM by eggtart_prince

Running 4558 tests in 1m 55sec (or saving 50 hours/week)

http://ift.tt/2qaIcEd

Submitted May 31, 2017 at 08:49AM by ginger-julia

Looking for Node.js tutorials

I've been trying to find some good tutorials that build some of the common starter apps in node. Just to see how some of the major concepts are used in an application. Any advice on where to find some?

Submitted May 31, 2017 at 05:59AM by boom_knives

When designing a web app with node.js as the client listening server layer and golang as a server api layer is it better that the database layer not interact with the node.js layer?

Mostly a best practice question. What are your preferences and/or thoughts?

Submitted May 31, 2017 at 06:04AM by _BubbaGump_

Tuesday 30 May 2017

How to make use of Oauth2 and Node

Hello, I want to start making using to Oauth2 for my API calls, but I'm not sure where to begin or how to do it. I've noticed there are auth providers but they all require their respective account (e.g. need a google account for google). I'm not exactly sure where to begin on implementing this. Can anyone help me out? Thanks

Submitted May 31, 2017 at 04:27AM by cruzcontrol56

Getting Started with Sequelize for Nodejs Applications

http://ift.tt/2rRLgZY

Submitted May 31, 2017 at 04:36AM by simplicius_

[Express] Newbie Error - Can't set headers after they are sent

router.get("/places", function(req, res, next){ database.Place.find({ "lng": req.query.lng, "lat": req.query.lat },function(err , places){ res.json({places:places}); }); return next(); }); router.get("/places", function(req, res){ database.Place.find({ "_id": req.query._id, },function(err , places){ res.json({result:places}); }); }); How would I incorporate next() and closing the header (I 've been told to return res.json())

Submitted May 31, 2017 at 03:16AM by badboyzpwns

Create a quick mock server with Canned.

http://ift.tt/2ri6wph

Submitted May 31, 2017 at 03:28AM by HadokoaMedia

Articles on async_hooks?

Or just a link to the new documentation. Or which tools/utilities take advantage of them.

Submitted May 31, 2017 at 01:16AM by runvnc

Node v8.0.0 has finally landed!

http://ift.tt/2rByb7r

Submitted May 30, 2017 at 10:05PM by magnav0x

What's New in Node 8

http://ift.tt/2siZSOu

Submitted May 30, 2017 at 07:10PM by treyhuffine

Can I have your thoughts on these two architecture possibilities?

Hi allI would love your thoughts on the items below.I am building a product which analyses log information.In a nutshell a large number of log data will be sent to a load balancer, which will then be distributed to a number of servers for processing, and finally get stored in a database.Option 1The load balancer sends the log data to a few single core servers. The node app on each server processes the data (cleaning, extracting relevant data, etc.), and either inserts or updates into a MongoDB database.Option 2The load balancer sends the log data to a few single core servers. The node app on each server encrypts the data and passes it to a message queue (e.g. RabbitMQ) run by a third party (e.g. CloudAMQP.com).Another bunch of servers takes the the data off the queue, decrypts it, processes it, and inserts or updates into a MongoDB database.~~~~~~~~There are pros and cons to both.Main pro of option 1: much more simple infrastructure.Main pro of option 2: more logical setup (i.e. each node app has a clear responsibility - producer or consumer).I like option 2 the most as it seems logically correct to me, and I like the idea of the first node app just grabbing the data and passing it on, rather than having to worry about any processing.However my worry is I am overcomplicating things, and in fact maybe the first node app has roughly the same performance in both options (process, insert into database vs. encrypt, push to queue), so it may make sense to choose option 1.Any thoughts appreciated.Thanks!

Submitted May 30, 2017 at 06:36PM by just_tech_stuff

Nodemailer emails not showing up on iCloud?

Hi Dotcomrades,I am using nodemailer to send out emails from my service. I have noticed that the body of these emails does not display on iCloud webmail. Anyone else run into this?For reference, I have a form on my homepage, at www.gibberit.com, that lets you send out demonstration emails. If you have an iCloud email address, you can see pretty easily, by sending yourself an email, that the body shows up as blank.I have seen a bit about iCloud not showing email bodies due to mimetype issues on Apple help forums, but true to form, the Apple forums have no solution whatsoever. (Note: I am, and remain, an Apple fanboy, but they are not perfect.)Anyone run into this issue? Any known solutions?Thanks!!!

Submitted May 30, 2017 at 05:55PM by libertymcateer

Reliably getting the domain/hostname from an incoming request

The referer header can be easily modified, so what are some reliable ways to get this info? A third-party service like recaptcha?I'm fiddling with a public API for contact form requests but I only want to allow requests from two domain names distinctly. Is this impossible in theory? I.e., if the API is public, it can always be spoofed?

Submitted May 30, 2017 at 04:44PM by SomeRandomBuddy

How to automate your product's release notes

http://ift.tt/2qCm7hj

Submitted May 30, 2017 at 04:26PM by CleliaMarchal

Unit tests vs. Integration tests

http://ift.tt/2pWXRpQ

Submitted May 30, 2017 at 03:25PM by Eric_Phelps

The Important Features and Fixes of Node.js Version 8

http://ift.tt/2rA9Xuq

Submitted May 30, 2017 at 11:31AM by hfeeri

Is there any reason to not use "req.ip" to get the user's IP address?

Hi allLooking at stackoverflow I see many posts recommending people to use req.headers['x-forwarded-for'] or req.connection.remoteAddress to get a user's IP address, however Express comes with req.ip and req.ips to do just this.Is there a reason to avoid req.ip and req.ips?Thanks

Submitted May 30, 2017 at 10:29AM by just_tech_stuff

The Problem with `npm install --global`

http://ift.tt/2qRZ3yi

Submitted May 30, 2017 at 08:47AM by katerina-ser60

Monday 29 May 2017

any open-source ui dashboard for pm2 available?

No text found

Submitted May 30, 2017 at 05:54AM by hbakhtiyor

Node.js Promises using the Q library, Part 1

https://youtu.be/Rs4dHutvXcQ

Submitted May 30, 2017 at 03:56AM by exitcharge

Using Node.js with ScyllaDB

http://ift.tt/2r4UReP

Submitted May 30, 2017 at 01:08AM by rusher81572

How do I go about creating an account connect window like facebook does.

Wondering how to make a pop up window for an account connection then once the account is connected, close the window and get the data back in the main window.

Submitted May 29, 2017 at 10:38PM by farhansyed7911

urlparamify: Parse all kinds of url, simple and complex, and provides a modifiable JSON object that can be converted to string

http://ift.tt/2qsxpcZ

Submitted May 29, 2017 at 08:28PM by heard10cker

Trello Clone 4.0.0 finally released

http://ift.tt/2oWqGXY

Submitted May 29, 2017 at 06:47PM by Datmadmouss

How to build and deploy a multifunctional Twitter bot

http://ift.tt/2qNLQXI

Submitted May 29, 2017 at 06:48PM by pmz

Help! Node can't get the user's IP address

HelloI hope someone can help me with this!I have a piece of JS on a website. It does a XHR to post some data to a node app:var xhr = typeof XMLHttpRequest === "undefined" ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest; xhr.open("POST", 'https://myserver', true); xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); xhr.send(JSON.stringify(data)); And in the node app it tries to grab the user's IP address through either req.headers['x-forwarded-for'] or req.connection.remoteAddress or req.socket.remoteAddress or req.ip, but I always end up with something like undefined or ::ffff:127.0.0.1.Do you have any ideas what could be causing this?Thank you.

Submitted May 29, 2017 at 05:31PM by just_tech_stuff

Node.js vs Nginx

I have a dilemma. For a generic web server, is it time we replace node.js with nginx? I've read it's best practice to place an nginx server in front of a node server, but what's the point?

Submitted May 29, 2017 at 02:48PM by LukeEllul

New features coming in Node 8

http://ift.tt/2rffe9x

Submitted May 29, 2017 at 02:57PM by kari0003

Getting Started with VS Code for Node.js Development

http://ift.tt/2rfgFF9

Submitted May 29, 2017 at 02:31PM by _bit

Creating separate instances of a game using Node

I'm making a multiplayer game in Node js at the moment, with socket io. The game works fine with less than 50 people, but gets way too crowded if there are more than about 50 people on the server at once, so I'd like to make it so that if there are more than 50, they connect to a new "instance" (?) of the game. I'm unsure of how to go about this. Do I need to use "clustering"? Would I need to use Node's rooms feature and then process the physics for each room separately, sending the clients only the data for their particular room?

Submitted May 29, 2017 at 01:23PM by J354

If anyone's using zsh-nvm you can now test the Node.js V8.0.0 RC with `nvm install rc`

If anyone's using zsh-nvm I just added nightly/rc functionality to nvm install. If you update you can do nvm use|install nightly|rc.% nvm install rc Downloading and installing node v8.0.0-rc.1... Downloading http://ift.tt/2qutpof... ######################################################################## 100.0% Computing checksum with shasum -a 256 Checksums matched! Now using node v8.0.0-rc.1 (npm v5.0.0-beta.56) rc -> v8.0.0-rc.1 Clearing mirror cache... Done! % node --version v8.0.0-rc.1 If you're using nvm but you don't wanna use zsh-nvm then you can paste this into your terminal:NVM_NODEJS_ORG_MIRROR=http://ift.tt/1JEnSxm nvm install node && nvm alias rc "$(node --version)" nvm ls-remote > /dev/null 2>&1 Enjoy :)

Submitted May 29, 2017 at 12:39PM by dyslexiccoder

Ever wondered why node js maintainers want to keep the core small?

http://ift.tt/2q5qtk0

Submitted May 29, 2017 at 11:16AM by fagnerbrack

Load Balancing Node.js Applications with NGINX and Docker

http://ift.tt/2qHALXH

Submitted May 29, 2017 at 10:06AM by ms-maria-ma

npm module to fetch comics from consolia-comic.com

http://ift.tt/2r3oYDk

Submitted May 29, 2017 at 09:01AM by datskinnyguy_

Sunday 28 May 2017

archiver and adm-zip are not working properly: help ?

Hello,For the export part of my software I need to put as an archive some datas. Unfortunately, archives made with adm-zip are half corrupted and archiver only works on development environment, for some reason : when I require archiver (or import), it'll return an error on the console : 'unknown pipe property on undefined'.So my only alternative is to find another package that would allow me to create an archive just like I would with both of them, and by that I mean adding a whole folder.Anyone knows any better zip package out there ? I can't really find a proper one with the npm search engine, they are all either outdated or broken.Thanks in advance.

Submitted May 28, 2017 at 10:06PM by IFThenElse42

Attacking NodeJS and MongoDB - Part To

http://ift.tt/1w8r1DT

Submitted May 28, 2017 at 09:24PM by pmz

Is there any Node ORM that is based on Observables instead of Promises?

No text found

Submitted May 28, 2017 at 09:31PM by pier25

N-API - API for building native Addons

http://ift.tt/2s49pda

Submitted May 28, 2017 at 05:00PM by mega_saft

Opening Browser on Wifi Connect (a-la Captive Portal)

I'll be honest, I haven't been using node.js for very long and really am only using it for a few specific things.I cannot find a Captive Portal package with a decent readme. Is there anything simpler where I can just display a webpage on the client's browser from my webserver to those who connect to my access point?Any help would be greatly, Greatly appreciated.

Submitted May 28, 2017 at 03:03PM by UntouchableC

pify - Promisify a callback-style function

http://ift.tt/1hmHJK5

Submitted May 28, 2017 at 07:33AM by sindresorhus

Saturday 27 May 2017

[Q] Store single JWT for all requests to external API

Hi,I need to use my application as a middleware/proxy to connect to an external API.So all my users can call my endpoint and this one will retrieve data from an external API.My issue is that I'm not sure what is the best strategy to authenticate and get the JWT from the external API and use that JWT for all the requests and then refresh it eventually.I don't need to store a JWT per user, is a JWT for my entire application.I was thinking on getting the JWT on the app startup and store it, then run a timeout to check if X amount of hours had passed to refresh it.But I'm not sure if this is the best/most secure approach.I'd appreciate any suggestions.

Submitted May 27, 2017 at 10:50PM by ezpzqt129

How does Node know how to execute the functions in this program in order?

In this program, how does Node know to the execute the for loop at the bottom, and then the middle function, and then the top function even if they're written in the wrong order? I get node is async, but I don't get how this works. var http = require('http') var bl = require('bl') var results = [] var count = 0function printResults () { for (var i = 0; i < 3; i++) console.log(results[i]) } function httpGet (index) { http.get(process.argv[2 + index], function (response) { response.pipe(bl(function (err, data) { if (err) return console.error(err) results[index] = data.toString() count++ if (count == 3) printResults() })) }) } for (var i = 0; i < 3; i++) httpGet(i) ` Why doesn't it just print undefined for the values of results array?Ugh, reddit formatting sucks, here's the code.

Submitted May 27, 2017 at 07:44PM by jimmypixel

How to install memwatch in my local windows machine

I am get error during "node-gyp rebuild". I even installed and configured python in my system still not working. Is there any way to compile the native modules on-line ?

Submitted May 27, 2017 at 03:19PM by karthik_tantam

escape-goat - Escape a string for use in HTML

http://ift.tt/2qYQLFe

Submitted May 27, 2017 at 12:25PM by mofle

Can I submit ajax form of login through node.js (client-side) ?

I attempting to create a chat-bot for some website and I need a way to send request (like ajax) to login with user+pass to the site, but I don't know how to stay logged-in to the website...

Submitted May 27, 2017 at 09:09AM by iDankMyMemes

Friday 26 May 2017

Looking for Express app project organization example

Is there a good best-practices example of how to organize the files and folders in an Express web + api application. I'm specifically looking for an organization using feature folders, not the classic MVC structure.Edit: I was able to find this repo which looks like exactly what I was looking for, but I'd love to see any other suggestions or feedback.http://ift.tt/1uKt3ZN

Submitted May 27, 2017 at 05:14AM by Catalyzm

Using Async/Await with Mocha, Express, and Mongoose

http://ift.tt/2qX6btt

Submitted May 26, 2017 at 06:28PM by code_barbarian

npm 5 released

http://ift.tt/2qVRyqp

Submitted May 26, 2017 at 04:36PM by ipgof

A way to inspect http requests made by node in Production?

In my dev environment I can use http://ift.tt/1130DKx network tab, but I'm finding some of the services our node apps to connect to can be quite flakey with weird response, and we need to see what exactly the http request and responses were. Anyone know of a way to do this? (Without have to resort to console.log)

Submitted May 26, 2017 at 01:17PM by loftyal

Node.js Weekly Update - 26 May

http://ift.tt/2s2RKli

Submitted May 26, 2017 at 12:06PM by hfeeri

Node.JS Top 10 Articles (May 2017)

http://ift.tt/2s2pvmB

Submitted May 26, 2017 at 10:10AM by itsawesomeday

Proper ExpressJS installation location?

Hello all!I wasn't sure if there was a "proper" installation directory (Ubuntu/Linux) for ExpressJS projects but I wanted to see just-in-case. Would it not be ideal to just throw it in a /var/www/ folder? Wasn't sure about security.

Submitted May 26, 2017 at 08:29AM by Miles360x

Thursday 25 May 2017

Nvm-helper: Automatically switch to current dir's requested node engine

http://ift.tt/2s1m6oa still have quite a bit of work left to do on it but it's working pretty decently now and thought others might find it useful.

Submitted May 26, 2017 at 03:50AM by edwmurph

Cheerio alternative?

I've never been a fan of jQuery and am more used to using vanilla JS ways of traversing the DOM (querySelector, getElementByID, etc) - I was wondering if there was something similar to Cheerio just in a vanilla JS syntax. I've been interested in scraping but don't really want to learn jQuery syntax just to find things I'm looking for in the DOM.Suggestions appreciated.

Submitted May 26, 2017 at 12:38AM by baxtersmalls

How to read/write data to ArrayBuffer from C++ Node.js addon?

In short, I have an addon that completes an operation which results in a uint8_t array. I need to convert this array and its contents to an ArrayBuffer, and return that.Conversely, the addon can also accept an ArrayBuffer as input, and I need to convert that, along with its contents, into a uint8_t array.I am having trouble finding clear documentation on how to do so. I am new to Node, v8, addons, etc. If someone knows how to do this and could help me out that would be great.

Submitted May 25, 2017 at 11:18PM by thegervais

NodeConf Argentina 2017 will take place October 26th - 28th

http://ift.tt/2qUlCCA

Submitted May 25, 2017 at 11:18PM by a0viedo

add whaleclub to gekko

Hi, i am trying to add whaleclub http://ift.tt/2nMDzkT to http://ift.tt/16G3oFz and am confused how to go about doing this http://ift.tt/2r153U0 I am a beginner trying to follow this documentation but am stuck for a while now I looked at a pull request for another exchange that was added do I add a whaleclub.js file with those functions listed in gdax.js but using the whaleclub api?http://ift.tt/2qhliPO

Submitted May 25, 2017 at 10:32PM by addwhaleclub

Newbie - Connecting to a route

Hi, for development reasons, localhost:3000 will not work. So I will be using my ip, which I found through looking at the properties of my wifi.I tried connecting to the server with http://196.xxx.xx.x/, but it will not work. Yet http://localhost:3000/ will work fine.I assume that node.js is unable to listen to the ip adress, how would you tell node.js to do so?My code:app.js var express = require("express"); var app = express(); var jsonParser = require("body-parser").json; var routes = require("./routes.js"); var port = process.env.PORT || 3000; app.listen(port, '192.168.2.89',function(){ console.log("server is listening on port"); }); app.use('/', routes); routes.jsrouter.get("/", function(req, res){ database.Place.find({}, function(err, result){ res.json({result: result}); });

Submitted May 25, 2017 at 10:54PM by badboyzpwns

Require NPM module in browser using Browserify

http://ift.tt/2rZyF3s

Submitted May 25, 2017 at 06:30PM by shsh3

6 Easy Steps to Install Node.js on Linux Ubuntu

http://ift.tt/2rUADTC

Submitted May 25, 2017 at 04:18PM by niravsh0102

Popular Node Packages

http://ift.tt/2rkOrJU

Submitted May 25, 2017 at 03:09PM by stephenbw

🐚 robbyrussell — a highly experimental cross-platform and cross-shell implementation of default prompt from Oh-My-Zsh written in JavaScript.

http://ift.tt/2qfvhVw

Submitted May 25, 2017 at 01:20PM by denysdovhan

Beginner looking for general tips/critique.

Hello guys. I am just starting out with nodejs and javascript and I am looking for some general tips and suggestions. I have a simple baseline/framework which I intend to use for future apps. Would you mind having a look and telling me if I am currently participating in any bad practices or the like? I would like to catch this in the updrift to eliminate bad habits from the get go. If this kind of post is not intended for this sub I apologize in advance.Here is the github page: http://ift.tt/2qZAfmL you for your time.

Submitted May 25, 2017 at 01:39PM by koala_with_spoon

iPython equivalent for node?

Is there something like iPython for node, that i can use in powershell to play around with single functions in my codebase?

Submitted May 25, 2017 at 12:31PM by Telcrome

Wednesday 24 May 2017

Q: Passort.js & Facebook

I'm trying to setup facebook authentication. I have a 'profile' table that stores relevent user information ( name, age, weight, etc ) and use a UUID for the primary key.For facebook auth, I created a facebook table that stores (facebookUD, profileUUID ) to do the mapping.What I can't figure out is how to get Passport to serialize/deserialize properly so that the req.user is MY user information and not the data from the Facebook authentication.I'm a total newb when it comes to Node.js & Passport.js, so please forgive me is this is a simple task. How do you professionals setup auth & session information like this?

Submitted May 25, 2017 at 01:40AM by lonehiker

My first creation with node.js and socket.io :)

http://css-tips.io:443/

Submitted May 24, 2017 at 08:48PM by Lewitje

Learn and Understand NodeJS

http://ift.tt/2rRt53U

Submitted May 24, 2017 at 09:10PM by rvarinder

Create a custom Slack slash command with Node.js and Express

http://ift.tt/2rUYHVB

Submitted May 24, 2017 at 07:20PM by loigiani

A Place to Save and Share Snippets of Code, Links, Todos and Notes - Made with Node & React

http://codeowl.io

Submitted May 24, 2017 at 07:34PM by sandcrain

Async best practices

I'm somewhat new to the world of async JS/node, and am having a hard time finding the best approach(es) to the whole "everything must be async" paradigm.Let's say you want to test sending a file. You get the file size that you're sending/have sent, and then compare it to the resulting file size after the far end finished downloading it. Short of setting /*jslint node: true, stupid: true */ how to ensure the steps are synchronous, but within the asynchronous mindset?I suppose a more concise question might be that according to this I should get the file size with something like:fs.stat(`test.txt`, function(err, data){ console.log(`file size: ` + data.size); }) Which isn't useful if you want that information later. And the best way around that, which I've found, is to do:var fileSize; fs.stat(`test.txt`, function(err, data){ fileSize = data.size; }) Is that the correct/best way? Does it even actually result in a synchronous call, or would it be possible that I somehow get the remote file size prior to the local one, and fail the comparison due to some IO issue? Is there a better/cleaner way to accomplish this? Also, I would personally prefer var fileSize = fs.stat(...) direct assignments instead of 2-stepping everything, is there a way to do that in asynch syntax (that's lint compliant)?

Submitted May 24, 2017 at 06:42PM by Gr1pp717

I created a real-time coloring game with NodeJS and Socket.io

Source code: http://ift.tt/2qgG1PE: http://ift.tt/2rANAV1 is a fun little real-time coloring game. You can share the coolest colors with your closest friends :)Hopefully someone finds this fun and useful, and let me know if you need any help getting started!Enjoy!

Submitted May 24, 2017 at 06:51PM by stanleycyang

module.exports best practices?

I'm having trouble determining the difference (if any) between these three expressions. It seems to me that they would all achieve the same end result. If so, which is the "standard" or largely preferred format and why?// exporting a function with nested functions module.exports = () => { foo() { } bar() { } } // exporting an object literal module.exports = { foo : () => {}, bar: () => {} } // export expression with named parameter module.exports.foo = () => { } module.exports.baz = () => { }

Submitted May 24, 2017 at 03:42PM by Midicide

The first 8 episode are done for the tutorial about making a NodeJS + MongoDB Rest API

https://www.youtube.com/playlist?list=PLzQWIQOqeUSMzMUEJA0XrOxJbX8WTiCJV

Submitted May 24, 2017 at 03:06PM by EQuimper

Top 7 JavaScript Frameworks a Developer Must Know

http://ift.tt/2rPukk9

Submitted May 24, 2017 at 11:14AM by PaulinaWilson

Need help for newcomers

Hi, I just start to learn nodejs, right now the nodejs is at v7 and stable version is v6 But so many resources and books are based on the previous version Can someone gives me some suggestion where to start, or some good books or blogs?

Submitted May 24, 2017 at 07:52AM by Lilo_D

easily implement API versioning for ExpressJS - provides a middleware to load controllers based on api versions.

http://ift.tt/2rPdl1k

Submitted May 24, 2017 at 09:25AM by lirantal

Tuesday 23 May 2017

NodeXchange — A Reverse-Proxy/Load — Balancer for Node.js

Hey everyone,Just launched an open-source NPM module for scaling distributed backends written in Node.js.I wrote a Medium article breaking down how it all works & provides a list of the features if any of you would like to read it about: Medium: http://ift.tt/2rOzvAR are the direct GitHub & NPM links if you just want to jump right into documentation & code.GitHub:http://ift.tt/2qChJQR NPM: http://ift.tt/2rfeZfA're really excited for the launch of this library and we really want the community to get involved and give us some feedback. We also welcome any contributions.Feel free to reach out to us on GitHub or direct message me here and I can get back to you personally.

Submitted May 24, 2017 at 04:35AM by dmckirnan

Looking for guidance on releasing my open-source application

Hello,I'm about ready to release my open-sourced project located here, and I think this is a really good application idea. But I don't know much on how to "release" open-sourced projects (or projects at all). So this application is like phpmyadmin, except much friendlier, not as many features, and is database-agnostic.But I'm confused on how to "release" this because the user has to clone this project, then compile the typescript into javascript, then run "node app.js" and it launches a localhost web app. But it should be easier for the user. I don't want them to have to typescript-build it, then run "node app.js." I just want them to access it right away. So what should I do? I don't know how to release a localhost website. I want the user to be 1 step away from seeing the final prodict. Not have to clone, build, then run "node app.js." I don't know what I want the end result to look like. Is there an open-sourced "website" that's released like this?I also have another question. This is a tool users use to connect to their database. But in the rare unlikely chance that this tool corrupts their data, I don't want to be in trouble for that. This is an open-sourced free-to-use web application. I wanted to release it to help people, not to be in trouble. Do I have to worry about this? Like... can I get sued if my project messes up their data, or held responsible?Thank you for the help.

Submitted May 24, 2017 at 04:12AM by AskYous

Having trouble understanding the benefits and point of using an .env file

I've seen a lot of node projects that have a .env file and then use the dotenv module to set your values on the process.ENV object.. things like keys and secrets and other constants needed throughout the app.I have seen this touted as a best practice because it follows 12 factor app principles and things like that, but it's just not making sense to me. Normally what I've always used is 2 config files, one for dev and one for production. The production config file gets all of it's values by accessing process.ENV, but the development config file has all of it's values hardcoded. Depending on the value of process.env.NODE_ENV, I choose whether to use the dev config object or the prod config object.All of the keys, secrets, and constants in the dev config have zero affect on the production environment, so even if a dev wants to be malicious with an API key or something, it really doesn't have an effect on anything of value.Because of all of the above, I'm failing to see the benefits of using the .env file. From what I've seen, the project normally has a dummy file like .env_example to provide guidance to anyone using the code, but it's their responsibility to create a .env file and fill it with key-value pairs. Also, it's promoted as a benefit to not have this file checked into git, which is why everyone needs to create their own .env file in the first place. This seems like a lot of extra work to me, and I'm not really seeing how it's more secure than using the config example I described above.I have a feeling there is more to using the .env file than I am realizing, so I'm looking for advice on this matter. I've never worked on large teams or big open source projects, so I feel I may be missing something here.Appreciate the help.

Submitted May 24, 2017 at 02:43AM by m9js

[Express] How do you save a document to a database efficiently?

Say I want to save multiple documents into the database;I feel like it would be inefficient if I change the placeDoc's attributes and restart the server every time I make a change.Am I doing it incorrectly? is there a much more easier and efficient way?var PlaceSchema = new Schema({ lng:Number, lat:Number }); var Place = mongoose.model("Place", PlaceSchema); module.exports.Place = Place; var placeDoc = new Place(){ lng: "333"; lat: "222"; } placeDoc.save().then(place => { return place.name; db.close(); });

Submitted May 23, 2017 at 11:12PM by badboyzpwns

Technical Skills for NodeJS Job

Hi, I'm looking to pursue a NodeJS position. The description of my technical skill seems to be a bit all over the place. I can't decide what to leave in and what to take out or if there is just a better way to list my skillset. When I finished college, I put down a host of different tech that I had worked with. I always hear the more the merrier, put everything down, but I think this section is beginning to become overcrowded.ImageAny advice would be greatly appreciated.Thanks.

Submitted May 23, 2017 at 10:20PM by EoinsReddit

Need some help improving my production setup

So right now I have my site setup on a $20 Digital Ocean instance, running expess.js postgres and redis through an nginx proxy, I know this is not the best setup, so I was thinking about moving towards Docker, but don't really know how to do this without interrupting service, and even moving to docker I don't know what would be the ideal setup, any help or ideas would be widely appreciated!

Submitted May 23, 2017 at 05:04PM by jcferrans

I've built a site to help programmers find a team for their project ideas

Hello,I've been working on a project as a way to teach myself programming. The site is called 42exp and is built on node/postgres. The relevant github repoAs a new/self-taught developer , i faced two problems which were driving factors to build the site.Lack of project ideas - I basically got tired of doing to-do lists all day for every language framework. I believe that the only way to gain practical knowledge in a language is to build a product which you would find useful.Lack of a team to bounce ideas off - Collaborating with other devs is something i could never experience . This i think is a major stumbling block in my learning. I liked django/node/DRF and wasnt comfortable with design. It would've been awesome to work with a designer who could take care of deciding how a site looks while i look into the backend or vice versa.The site is still new (buggy is probably a better term) , but i would love it if you guys can try it out , provide feedback and start your own projects.Thanks for the read, KJ

Submitted May 23, 2017 at 03:36PM by __kannaj__

The Node.js Interactive North America agenda has been announced

http://ift.tt/2izppiS

Submitted May 23, 2017 at 03:45PM by _bit

Node.js Streams: Everything you need to know

http://ift.tt/2qbQr2Z

Submitted May 23, 2017 at 03:12PM by samerbuna

Getting Started with AWS Lambda and Node.js

http://ift.tt/2qR9xi6

Submitted May 23, 2017 at 03:09PM by hfeeri

Need help with middleware.

I have a post request, which i have a middleware function being called onto it. like so:app.post('/sign-up', signUp, function(req, res){}) Here's the signUp function: var signUp = function(req, res) { //Simplified for brevity if (user) { res.redirect('/'); } else { res.redirect('/login') } res.end(); } My problem is, it's not redirecting to the page. I know im doing something wrong, im new to middleware. Would like some tips. Thanks.

Submitted May 23, 2017 at 11:40AM by farhansyed7911

Monday 22 May 2017

Is there a user and organizational handling platform like Github but open scource?

I have been writing a new nodejs, expressjs, handlebarsjs platform and require a user interface similar to the user and organizational interface used on the GitHub service. Is there an example crud service (express) that can be download to save the hundreds of hours required to develop this.The closest so far, and what Heavy-lifting is based on is: Megaboilerplate it is limited in the functionality and requires a lot of further development from a permissions basis.If not, then please see my work in progress, and feel free to help out in its development.(CRUD: Create Read Update Delete) Specifications: User CRUD with WordPress level permissions. Organizational CRUD with owner, member level permissions. Integrated paypal and credit card payments (to copy GitHub).See the GitHub Site : Heavy-lifting RepoOr the Demo : http://ift.tt/2q5l8dX a million!

Submitted May 23, 2017 at 05:40AM by jdav89

Just curious to learn: Where can I learn about adding 'plugin' capabilities to my node app ?

You know how Wordpress allows you to add third party plugins, same for Eclipse and other apps. How would I go about that in NodeJS ?Extension points ? How exactly does that work ? I did some googling and found that 'plugins' use what is called IoC, (Inversion of control). Where can I learn more about this ? I saw some npm packages that 'allow for IoC' but a lot of them seem to really be outdated. Here are some:http://inversify.io/ (Pretty complex...)http://ift.tt/2rN9uRI (Last update was a year ago...seems abanoned, but it looks more friendlier)http://ift.tt/2qPj5Ka 'Eclipse' insipired...3 years ago was the last update...and it didn't seem that popular :/These repositories seem cool to use but I'd like to understand more about IoC concept...and maybe make my own version of 'add plugins to the app!' ? (lol)...heck maybe learn more about design principle in general. Where can I learn more ? This is cool stuff!

Submitted May 23, 2017 at 03:43AM by HappyZombies

/r/changemyview is looking for help with DeltaBot

http://ift.tt/2rb46vn

Submitted May 23, 2017 at 01:12AM by Snorrrlax

Realtime request/response monitoring middleware for Koa, Koa2 and Express

http://ift.tt/2ruLdTZ

Submitted May 22, 2017 at 11:32PM by indatawetrust

What's New in Mongoose 4.10: Unique in Arrays

http://ift.tt/2rJTTD7

Submitted May 22, 2017 at 10:58PM by code_barbarian

How can I create a chat made in node.js using the hangouts api?

How can I create a chat made in node.js using the hangouts api?example : http://free4talk.com/

Submitted May 22, 2017 at 08:15PM by siwars

Load Balancing Node.js Applications with NGINX and Docker

http://ift.tt/2qcVvU5

Submitted May 22, 2017 at 07:12PM by Ramirond

is it "okay" to put codes in the routes?

So coming from the PHP world, I am diving into NodeJS, ExpressJS to be more precise, one of the things I find a bit difficult is the "we have no structure, do as you like approach". I've always learned that code in routes is no-go, I would learn it "correctly" the first time, So I'm looking at this Gothinkster app example http://ift.tt/2jP9MEm And see all the logic in the routes, so I guess my question is if it's actually are normal, and if people have some other app examples they could share.

Submitted May 22, 2017 at 07:44PM by cawex

Help debugging a node app

Hi guys,I'm a relatively green web developer (~2 years professionally) who has plenty of experience writing code for Node/React apps, but little experience managing performance or DevOps-ish type stuff.I have a hobby app that typically has anywhere from 15-30 users at any given time. It is a Meteor app on a Digital Ocean server deployed with mupx (Docker).I run into weird performance issues that I just don't know how to properly debug. Its very difficult to reliably reproduce -- I'll get messages from people saying my app load time is really long (sometimes for no reason I can see my CPU usage will shoot up to >100%).I decided to switch to a PaaS to offload some of the DevOps stuff I'm not familiar with, but it hasn't really helped. I have 2 containers running which seems like it should be more than enough for what I need, and yet with just a little bit of load it seems to take a massive performance hit.CPU spike with just one hitInitial load timeIf I spin up ~30 instances of the site, load time jumps up almost 10xEven if I cache the relatively large initial data dump ( a collection of ~4.5MB) and skip the database trip entirely, it still takes about 3 seconds to load everything into memory.I'm not asking for anyone to solve this problem for me, just looking for advice on where to begin debugging something like this. Thanks guys!

Submitted May 22, 2017 at 06:18PM by sicknarlo

AWS Lambda - Node.js - Automated Testing

I have been given a codebase built entirely in AWS Lambda (Using the serverless framework). I am trying now to setup a test suite in order to get to know the codebase and to be able to safely make changes. But Im having a hard time with AWS's SDK for Javascript. It doesn't seem to be able to be mocked.What I need is to isolate the codebase from other AWS services like S3 and DynamoDB. Sinon and the (one and only) aws-sdk-mock packages doesn seem to work. I was wondering how did you structured your codebase to be able to be tested. Were you injecting an aws-sdk instance in each function? Were you even doing such testing locally?Thank you

Submitted May 22, 2017 at 03:16PM by kostarelo

“camelCase” <=> “snake_case” conversion with PostgreSQL and Knex.js

http://ift.tt/2r8Wqtq

Submitted May 22, 2017 at 01:57PM by koistya

Sunday 21 May 2017

Sharing: My Node/Javascript Toolkit

http://ift.tt/2qFHiSK

Submitted May 22, 2017 at 04:41AM by voiping

understanding callbacks with a specific example.

Hey folks, I just got back from my first hackathon, and I was on a team using node-mysql to get data from a mysql database then return that data for front end use. We ran into an issue and ultimately decided to solve our problem a separate way, but I have a specific question about this particular section of code, and understanding how to get it to work.It took a bit to realize there was an async aspect of node because none of my teammates were familiar with it. We noticed things weren't printing in the order we expected, and we found out callbacks were needed but we could not implement them properly ultimately. I don't want to let this go though without understanding. I read multiple articles on call backs, and I couldn't wrap my head around this which is disappointing me.getData(input){ var output = 0; var mysql = require('mysql'); var connection = mysql.createConnection(); //other connection and server setup here connection.connect(function(err){ connection.query('SELECT * FROM table WHERE tableData = input', function(err,result){ if(err) throw err; output = result //console.log(result) connection.end }//connection.query close }//connection.connect closed return output; } start(){//for testing the above function var arr = getData(); console.log(arr) //query data is expected as the result, but 0 is returned } start();//run the start function Can anyone help me figure this out? I kind of understand at a surface level what's going on with asynchronous code, but I don't understand how to make it work with node's syntax, and I feel like node related documentation is pretty bad, or I'm not smart enough for it (or maybe both).

Submitted May 22, 2017 at 01:27AM by SimplestMachine

Get nodejs working with letsencrypt through traefik

I have just begun looking at traefik as a reverse proxy for my nodejs application I am running in docker.Now I am looking into how to get letsencrypt to work with traefik. I have never tried something like this before, and I am therefore looking for a more or less step by step guide.ATM I have these different files to spin it all up with docker-compose:Dockerfile:FROM node:6.3.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app RUN npm install -g nodemon COPY package.json /usr/src/app RUN npm install COPY . /usr/src/app EXPOSE 3000 CMD ["npm", "start"] docker-compose.yml:version: "2" services: web: build: . volumes: - .:/app ports: - "3000:3000" links: - database labels: - "traefik.port=3000" - "traefik.backend=web" - "traefik.protocol=https" - "traefik.frontend.entryPoints=https" - "traefik.frontend.rule=Host:hostname.com" database: image: mongo container_name: mongo ports: - "27017:27017" volumes_from: - mongodata command: --smallfiles --noprealloc mongodata: image: tianon/true volumes: - ./data/db:/data/db traefik: image: traefik:v1.1.1 command: --web.readonly --docker --docker.watch --docker.domain=docker.localhost --logLevel=DEBUG --entryPoints="Name:http Address::80" ports: - "80:80" - "443:443" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/traefik/traefik.toml:/etc/traefik/traefik.toml - /etc/traefik/acme.json:/etc/traefik/acme.json traefik.toml:defaultEntryPoints = ["http", "https"] [web] address = ":8080" [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] [acme] email = "my@email.com" storageFile = "acme.json" entryPoint = "https" onDemand = true onHostRule = true Some of the things I am speculating is how the certificate is generated. Do I do this elsewhere or is this taken care of from traefik. When I read different guides it seems like this is taken care from by traefik, but I cannot access my site with httpsI hope this is the correct place to ask. Otherwise let me know. I am only here to learn :)

Submitted May 21, 2017 at 11:47PM by lidttilvenstre

HELP! How can I create and manage multiple twitter bots?

I'm new to Node, so sorry in advance if this is a stupid thing to ask.I'd like to make a website where users can create,stop/resume and edit their Twitter bots which would run 24/7.What would be a good way to create and manage/monitor these bots/processes. Are there packages that exist for this kind of thing? or do I have to make my own using child_process? How would I make so the processes get saved and survive server restarts and crashes?I've looked into child_process API but I can't picture how exactly I would put it together for this.

Submitted May 21, 2017 at 07:28PM by Artaelz

I just published express-session-helpers, a WIP set of features to enhance using sessions with express

Link to check it out:http://ift.tt/2qISGh9 probably only applies to people who don't use express just as an API.Right now there are two modules available, flash and old.flash lets you store items in the session for the next request only, and old lets you send back the input from the last request quickly and easily (also only available for the next request).I have plans to add more but these are the ones I have ready with complete test coverage :)Looking for all types of feedback!

Submitted May 21, 2017 at 07:38PM by nehero

[Nodejs] Security: Broken Authentication

http://ift.tt/2qKSMDc

Submitted May 21, 2017 at 12:12PM by bananajsjs

Protect by RisingStack - Proactively protect your Node.js web services

http://ift.tt/2rujhfW

Submitted May 21, 2017 at 11:11AM by dobkin-1970

Saturday 20 May 2017

implementation of C printf funtionality

http://ift.tt/2r4SWbB

Submitted May 21, 2017 at 03:52AM by 73mp74710n

duty-js V2.0.0 with desktop notification

http://ift.tt/2p96q4T

Submitted May 21, 2017 at 03:35AM by 73mp74710n

Multiple queries/UPSERT in node postgres

Is there anything wrong with making multiple queries in one connection and ajax call?For exampleapp.post("/queries", function(req, resp) { pg.connect(dbURL, function(err, client, done) { client.query("SELECT ... ", function(err, result) { done(); }); client.query("INSERT INTO...", function(err, result) { done(); }); }); }); Now, specifically for what I am trying to accomplish. I am trying to UPSERT. Basically, SELECT from a table, if result is equal to 1, UPDATE, otherwise, INSERT. Here is what I have in mind.app.post("/upsert", function(req, resp) { pg.connect(dbURL, function(err, client, done) { client.query("SELECT ...", function(err, result) { done(); if (result.rows == 1) { client.query("UPDATE...", function(err, result) { done(); }); } else if (result.rows == 0) { client.query("INSERT...", function(err, result) { done(); }); } }); }); }); Is there a way to do this in one query?

Submitted May 21, 2017 at 02:40AM by eggtart_prince

Need help with Yield and Generator functions

I'm still trying to grasp the concept of generator functions and yield so bear with me.I'm using Adonis.js and things are going well for the most part, but I've hit a snag. I'm trying to ajax call to a url, which then uses the Plivo library to send an SMS, then returns the result (if it sent or not). The code is executing and Plivo is sending the sms and console.logging out the result, but the output json is being returned to the front end before Plivo is finished.So my question is: how do I wait for Plivo to finish sending the SMS before returning the json to the front end. Adonis allows me to yield a DB call, so the code "waits" for the DB result before continuing, but if I yield the Plivo call:var output = {} yield Plivo.send_message(params, function(status, response) { if (status === 202) { output.status='success'; console.log('success'); } else { output.status='fail'; console.log('fail'); } }) return response.json(output); I get an error about "You may only yield a function, promise, generator, array, or object, but the following object was passed: "undefined""Any help would be greatly appreciated.

Submitted May 21, 2017 at 03:06AM by svenjoy_it

Basic Nodejs application running in Docker with Mongodb on VPS

Hey guys..I am just starting to work on an application, and I am at that point where I want to access it from an online API. I have bought a domain and a VPS (scaleway)I have a working Dockerfile and docker-compose.yml for getting the containers running, but I am having trouble with accessing it from the URL. I think it has something to do with the ports, but I have tried changing it to port 80 in order to reach it, but have failed.Do anyone have a guide that I can follow in order to get this to work? I have tried a couple of guides some of them including nginx and some just using iptables to route traffic from port 80 to 3000 (my port for nodejs).

Submitted May 21, 2017 at 01:10AM by lidttilvenstre

Why isn't the last two being read properly? In the logs, it's saying can't find the modules. I'm confused.

http://ift.tt/2qJdjb7

Submitted May 20, 2017 at 10:26PM by farhansyed7911

What template engine are the cool kids using these days?

I've been using React and building API's for so long, I haven't kept up with it. Are there any new popular templating engines or does everyone still use EJS and Handlebars?

Submitted May 20, 2017 at 10:35PM by devdebonair

What is the best way to get 1 email address for a Heroku/Node server/domain?

Often times the domain host will provide email services, but because of our DNS settings (virtually hosted on heroku) they do not.Google for Work used to provide 1 free email address, but now charges a rather large fee.It seems silly to setup SMTP on Node for just 1 single address.Any help appreciated.

Submitted May 20, 2017 at 06:34PM by bishopZ

Kotlin with node.js

Have you used Kotlin with node.js? What is your experience with it?

Submitted May 20, 2017 at 05:08PM by blu3pegasus

Authentication with Express + React

Hi, I'm working on a project and I need to add user authentication. I have an express api, and a React front-end.I started adding authentication with Passport js and JWT, but I've been reading this is not a good usecase for JWT and it's not really secure. But it seems very straight-forward to me.How do I go about using Passport Local Strategy, with sessions, and combining this with React? I don't really get how React is supposed to 'know' about this session and how I can authenticate further API calls?So let's say I make a post from my React app with user credentials, my api takes this data, and checks it against the db. If it succeeds it creates a session. But how does this get back to React, how can I check on the front-end if a user is authenticated?Maybe I've just got this all wrong and it's way more simple than I imagine?Any help would be appreciated.

Submitted May 20, 2017 at 04:53PM by Puzz1es

Screen question for the group

I'm putting a job requirement together for a Node programmer.I care more about how good the programmer is than how many years they have, and don't want to overload the job description with enough acronyms to kill a horse (many of which could be picked up in a day by the right person anyway)Any advice on how to find a fundamentally solid Node developer that can handle a project that can scale to a true enterprise level, and no just someone who programs using Node?

Submitted May 20, 2017 at 01:14PM by beansedb

Friday 19 May 2017

Loopback Next framework

http://ift.tt/2pe9Kuo

Submitted May 20, 2017 at 01:42AM by hbakhtiyor

Question about Mobile app

Hey guys! First time posting and a beginner with Node. I am building a mobile app that stores the information for every user as well as a profile picture. I was curious how I would go about storing the image and connecting it to each certain user. I am currently using Mongoose schema for each user. I was reading about using S3 as a place to store all my images but I wasn't sure how to go about that and connecting those images to the users and implementing it into the schema. Thank you!

Submitted May 19, 2017 at 11:21PM by Basicbeta22

If you had 15 mins to wow your audience using Node.js, what would you do?

So tomorrow I'm going to speak in a conference and I want to write some code to demo Node.js. I really, really, really don't want to do another Express/Socket.io app..I will have only my notebook (so no IoT stuff 😓)Will have internet connectionIt's ok if I have to install something before the talkMacI'll have ~15 mins to finish the codePlease enlighten me with your ideas!

Submitted May 19, 2017 at 10:38PM by alanhoff

Why wouldn't I used Parse on the backend?

Thinking about implementing a server in parse. Normally, I've just built an API and used alamofire. I'm thinking about using Parse. What are the downsides?

Submitted May 19, 2017 at 03:05PM by DylonDylonDylon

RethinkDB transfer tool for MongoDB database

http://ift.tt/2rzohiE

Submitted May 19, 2017 at 02:41PM by indatawetrust

Electron Node.js module for controlling Spotify+iTunes on macOS

Hey,Here's another module I wrote for use in one of my projects: node-osx-mediacontrol.It aims at allowing a client to listen for playback events on Spotify or iTunes (play/paused/stopped) and allowing playback control (start playback, pause, stop, etc.)In this first version you can hook up a callback to receive playback state from iTunes, as well as play/pause iTunes. I thought I'll publish it early and then add functionality, that way everyone can (if they want) contribute very early on.node-osx-mediacontrol is available via npm (the github link is on the npm page)The project I'm using it in is DeviceCast: http://ift.tt/2qB9TsN's an app that allows streaming of macOS audio to either Chromecast or UPnP devices (Jongo speakers, or Raumfeld devices). It's a heavy state of flux, but streaming to Chromecast and Raumfeld works great.It's quite smart in that it will e.g. stop the streaming when iTunes stops or start streaming the audio to the most recently connected device when you start playing in iTunes, etc.Anyway, have a nice day everyone.

Submitted May 19, 2017 at 02:44PM by FedExFacto

Node.js public key infrastructure management library inspired by EasyRSA.

http://ift.tt/2q3gh8s

Submitted May 19, 2017 at 10:26AM by olouv

Node.js Weekly Update - 19 May, 2017

http://ift.tt/2ryEKnV

Submitted May 19, 2017 at 10:30AM by hfeeri

A Security Toolbox for Developers (API)

http://ift.tt/2pVfTsG

Submitted May 19, 2017 at 09:18AM by ecares

Thursday 18 May 2017

Developing Microservices - Node, React, and Docker

http://ift.tt/2pRkfWx

Submitted May 19, 2017 at 06:57AM by ginger-julia

Microservices made easy with Node.js

http://ift.tt/2q0C7cv

Submitted May 19, 2017 at 03:59AM by dashersw

Is it worth sticking to mongodb with GridFS or should I just use MySQL?

I discovered today about the little fact that BSON document sizes are maxed at 16mb. Because of reasons from what I can tell. Before someone says it, yes, I read the docs on mongodb about memory issues. I find that to be a shit excuse. Maybe 2gb or something like that as a max makes logical sense for a server environment, kind of. But not 16mb. But whatever. That's more of a water cooler discussion.I see there's a GridFS solution. Anyone with experience using huge datasets using mongodb/gridfs? Is it worth it? Pain/struggle? Or should I just have nodejs hook to mysql and call it a day? I'm sort of at the point that I should choose now before a point of no return. Well, super painful return worth of rewrites.The thing that just threw me off about this is hearing a bunch of hype from the past few years how mongodb is somehow magically better at huge data than MySQL. Doing research lately, I've been reading that it's not the case as long as I index my tables properly. So, just wondering if anyone out there has a personal opinion from experience about mongodb and large data. I could very well be missing some vital bits of info that makes everything make sense. I'm only 2+ weeks into nodejs.Thanks for any input.

Submitted May 18, 2017 at 10:51PM by Corodra

Reddit-Snooper - Reddit bot framework for Nodejs

http://ift.tt/2rcaoqf

Submitted May 18, 2017 at 09:48PM by pmz

Create a NodeJS + MongoDB Rest API [Part: 2]

https://www.youtube.com/attribution_link?a=xMC39mDkpa4&u=%2Fwatch%3Fv%3DPuY3w1VY0z8%26feature%3Dshare

Submitted May 18, 2017 at 05:29PM by EQuimper

What options are there for production ready web frameworks?

PHP/Laravel user here and I want to start using node to build apps.In a perfect world, I'd have at least these features:TypeScriptORMIt seems like my options areExpress - I'm leaning towards just using express and attaching an ORM. Are there database migration packages out there that actually build the database instead of just seeding it?Koa - Same deal as express but I have to plug even more things in, e.g. routingAdonis - This seems to be a Laravel remake in Node. Is anyone using this in production?What are you using?

Submitted May 18, 2017 at 06:03PM by nehero

Mongoose/Mongodb Cross Collection Transactions/Rollbacks

I will preface with I know mongodb isn't designed to be heavily bound by reference based relationships (Thats what good ol SQL is for), but I have inherited a very heavily reference based mongoose schemas. Pretty much everything is reference bound between different collections. Its really close to how a traditional SQL DB looks.So to my understanding mongodb has transactional locking at the document level, but it doesn't support cross collection transaction protection. I am debating on writing a functional wrapper above mongoose to protect against creating orphan/malformed records (these really aren't documents). Has anyone else had a similar scenario or know of any libraries that assist in this issue. Refactoring isn't an option at this point.Any suggestions are greatly appreciated, thanks in advance.

Submitted May 18, 2017 at 06:30PM by moaxaca

Why do I suddenly keep having gulp version mismatch global<>local when installing Gulp?

After installing gulp ("npm install gulp --save-dev"), upon launching "gulp watch" I now systematically get:[16:49:48] Warning: gulp version mismatch: [16:49:48] Global gulp is 3.9.1 [16:49:48] Local gulp is 1.0.0 Which forces me to do "npm install gulp@3.9.1 --save-dev". But why does NPN install gulp version 1.0.0? And why it never used to do that on my machine up to a week ago?

Submitted May 18, 2017 at 04:52PM by draikin3

[Help] Noob coder seeking help fixing bot.js file (KOTK gambling site)

Hi there, ive been working on my site for over 3 weeks now. First things first im not using a leaked script, i purchased this script and bot files.After 3 weeks of learning the basics Ive finally setup the website and all is running fine until i came across an error while withdrawing items from the site, the depositing works fine.I have managed to ask around on other support forums and found out what the problem is, its just im to noob at coding to know how to fix it.This has put me in a really depressing space as the website is 99% complete and the only issue from making it go live is this withdraw error.Here is a screenshot of the Bot console, http://ift.tt/2rvmPOj the problem is that as you can see its adding names and not an assetid this is why its giving me error 8. like i said earlier I dont know how to fix this.here is the code in the bot.js file that needs fixing http://ift.tt/2qWhkMs I have tried to fix it myself but still will not work, at one point the error was because of the appid not being appId...but i fixed that, the only error is because its pulling names instead of appids.Please please could someone assist me with this, im honestly so depressed and mentally drained trying for 3 weeks to get this shit running and then run into an error i cant fix. Thanks for reading and I hope someone can help me!

Submitted May 18, 2017 at 04:59PM by ihaveacrackproblem

New load-balancing/reverse-proxy library on NPM

http://ift.tt/2rv17uq

Submitted May 18, 2017 at 03:31PM by dougcal

Writing Node.js scripts with ClojureScript

http://ift.tt/2pClPIx

Submitted May 18, 2017 at 02:36PM by harlampi

Node.js main disadvantages?

Hello Node community. First of all I'm not sure if this type of post is against the sub's rules or not, sorry if it is!I am in my final year of college doing software engineering. I recently started learning Node.js and started working on a webapplication using it. I have to write a massive paper on a certain topic, which I chose to be Node.js. I have been looking into advantages and disadvantages, but most of these are fairly old. I am wondering what you, as Node.js user, think are the biggest disadvantages, where does Node 'not' shine, and most importantly why?Thanks for your time!EDIT: What is the reason for downvoting my question?

Submitted May 18, 2017 at 12:57PM by inochy

Debug network requests in node?

I've been using node-inspector, but since the built in inspector has been introduced I'm not using node-inspector as much. But I am missing network inspector, is there any standalone network inspector out there that is quick and easy?

Submitted May 18, 2017 at 11:35AM by loftyal

The new template engine for Node.js and browsers.

http://ift.tt/2fjZugQ

Submitted May 18, 2017 at 10:16AM by eshengsky

JavaScript Libraries for Progressive Web Apps

https://workboxjs.org/

Submitted May 18, 2017 at 11:01AM by ratancs

Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.

http://ift.tt/2gU7W5T

Submitted May 18, 2017 at 11:02AM by ratancs

Packing a Kubernetes Microservices App with Helm

http://ift.tt/2pNWK0v

Submitted May 18, 2017 at 08:57AM by hfeeri

Express: how to handle errors into a route handler that uses promises?

I'm trying to understand what's the best way to handle errors in express.I have a route handler that does some sync computations in the beginning, and after it is done searches the DB. After the DB returns, some more computation is needed.It's a very common sequence of actions so i'm sure you all did it.I have implemented the DB search using the promise flavour instead of using callbacks.I want to understand how to properly handle errors depending on where I need to raise/throw errors.So, here is the pseudo-cod, please check the comments for clarification of my question:router.post('/test', function(req,res,next){ // some sync computation, eg. read headers let header1 = null; try{ req.headers['header1']; }catch(err){ return throw(new Error('header not found')); // is this ok here? } db.find({ where: { id: header1 } }).then((data)=>{ // do some computation with data data.value1 += 1; // if an error occurs here, or I want to generate an error on purpose, how should I handle it? // 1. throw new Error('blabla')? -> will go to the catch where maybe I can return next(err) // 2. return next(new Error('blabla'))? }).catch((err)=>{ return next(err); }); } I hope my question makes sense.tldr: if an error happens or I want to raise an error into the .then function of a promise, should I directly return it there thought return next(err), or throw the error to pass the handling to the .catch method?

Submitted May 18, 2017 at 08:23AM by honestserpent

Wednesday 17 May 2017

Create a NodeJS + MongoDB Rest API [part: 1]

https://www.youtube.com/attribution_link?a=uLw0Cx9tTL0&u=%2Fwatch%3Fv%3DUL66bwInJHY%26feature%3Dshare

Submitted May 17, 2017 at 11:29PM by EQuimper

Youtube API is VERY confusing. Want to verify a user's youtube account.

Hey, I'm fairly new to Node in general and working with APIs I'm still somewhat new to as well. I have worked with mostly open JSON apis in vuejs rather than anything back end.I want to work on a node project but I can not find anything too helpful for something as simple as I need, I don't even know WHICH google or Youtube API I should use.I simply what a user to be able to authenticate their youtube channel to prove they are the owner of it, beyond that I need no more information or permissions. I want to know the subscriber count too if that is easier from within one of the APIs or I can grab it externally.

Submitted May 17, 2017 at 11:01PM by Ampix0

Elasticsearch transfer tool for MongoDB database

http://ift.tt/2rs3AoX

Submitted May 17, 2017 at 10:11PM by indatawetrust

Is it possible to bind port and hostname to a Node.js HTTP server without making it listen yet?

Hello!My question is if I could bind the hostname and the port to a HTTP server for NodeJS without making it listen. As far as I've seen, in all the examples about how to set up a Node.js HTTP server, the host and the port are indicated in the function "listen" of the net.Server object that Node.js handles. My question would be if I could bind them without making the server listen, so when I want to make it listen, I don't need to indicate them.Thank you!

Submitted May 17, 2017 at 07:52PM by ChangeTheGlobe

Create a Continuous Deployment Pipeline with Node.js and Jenkins

http://ift.tt/2oGNEgE

Submitted May 17, 2017 at 06:29PM by dobkin-1970

Our OSCON Demo: A GitHub and IBM Watson Powered Slack Bot

http://ift.tt/2pWdIoo

Submitted May 17, 2017 at 02:16PM by nslater

Add git-like functionality to your application using Event Sourcing

http://ift.tt/2pKGugP

Submitted May 17, 2017 at 02:20PM by lucasmajer

suggestions for Open source forum written in nodejs

Does anyone have suggestions for an Open source forum written in nodejs? Most are in php and I don't really like developing with that.

Submitted May 17, 2017 at 02:37PM by whooyeah

How to deploy Meteor Apps with pm2-meteor

http://ift.tt/2rqFfjS

Submitted May 17, 2017 at 01:59PM by tknew

Need some advice in regards to building a basic CMS for a client.

I'm building a website for a local sports team at the moment and they want to be able to update tables, results, player profiles and the like. I've been writing my own simple CMS for them to do this but see some people warn online not to code your own CMS.I've been seeing people recommend to use the tried and test with regards to CMS. But I've been struggling to find a good CMS for Node that offers me a range of flexibility. Is it that much of an issue if I write my specific custom one for this project?It's a barebones simple system that doesn't need to have the ability to add static pages, just an admin panel where people can update results and add the occasional blog post. Is there anything I should be warned about in regards to security or in general before doing this?Many thanks.

Submitted May 17, 2017 at 11:55AM by bolt_blue

How to handle an error from a stream that you're piping as an HTTP response?

Here is a gist with both the server/client code, but I'll post the server code here as well:const Router = require('koa-router'); const fs = require('fs'); const generateFile = require('./generateFile'); const router = new Router(); router.post('/getFile', async (ctx) => { const filePath = generatePDF(ctx.request.body); const rs = fs.createReadStream(filePath); // This might throw an error rs.on('error', (err) => { ctx.response.status = 500 // This isn't working. The status code of 500 doesn't seem to get sent to client. ctx.response.body = err // I don't think this `err` object makes it to client either. console.log('hi'); // This DOES run when there is an error }); ctx.response.type = 'application/pdf'; ctx.response.body = rs; }); Here is basically what I am trying to do:Create a PDF stream from the request body sent from the client.Pipe that stream to the HTTP responseHowever, in some cases the PDF might not be generated in which case createReadStream will throw an error.In the cases where there is an error, my fetch code in the client always gives a response of 404 even though I set the status to be 500 in my server code.tldr: Why isn't my server side code sending the right stuff to the client when there is an error? And am I not doing this error handling properly in general?

Submitted May 17, 2017 at 12:57PM by inhwjs

Bookshelf extension that adds some functions from Laravel's eloquent ORM.

http://ift.tt/2rpUJ7N

Submitted May 17, 2017 at 11:31AM by adobnikar

ettiquette for npm package ownership & forks

If there's a package with the right name, no commits in three years, more than a dozen issues & outstanding PRs.. should I publish a fork or merely be a contributor?My commits thus far have added significant features far beyond what the original code base intended. I don't think any part of the owner's code base remains unchanged aside from a few dependencies (which have changed to ES6 syntax anyway).At first I made a PR against the repo which resolved all the outstanding issues and included all the PRs which seemed appropriate. In the PR comment I suggested that the owner add me as a collaborator or consider changing ownership.He said he "was open to transferring ownership", so then I pushed a bunch of additional commits adding additional features. A few days later he added me as a collaborator.I guess the pointy end of my question is how important package ownership actually is, if at all ?To explain, I'm an amateur, but it's conceivable that at some point in the future I might want my github profile to look attractive to some prospective employer. Do people reviewing my stuff care or notice whether I'm contributing to packages I own?In addition... it's shallow & pretentious of me, but it's nice to publish packages and see how many downloads they're getting on npm, or stars they're getting on github. I think it will always bother me that these stars or downloads won't appear under my account.Obviously, if I was working with others on a package then it wouldn't matter at all that the package is owned by some organisation or whatever. But in this case it kind of feels like I'm investing a lot of time and effort in something only to benefit someone else's reputation who, at this point, is pretty much just camping on the namespace.So yeah, thoughts / guidance very much appreciated.

Submitted May 17, 2017 at 10:50AM by with_his_what_not

use express-react-views as expressjs view engine

Hello, I am going to use expressjs for rendering some simple, not dynamic landing pages. I was considering to use handlebars engine for it, but I more like JSX syntax where you can use javascript to format html elements. And I found this engine http://ift.tt/1pfgbre It looks like you can write jsx syntax code - react components + include other components from files. For me it looks easier than use handlebars syntax templates. But I don't know if it is compatible as handlebars to render html pages. And what about performance ? did you have experience with that? is handlebars faster? because its more template rendering than in express-react-view case JSX,javascript rendering to html ?

Submitted May 17, 2017 at 08:03AM by stolendog-1

Tuesday 16 May 2017

Eight Node.js Events to Attend in 2017

http://ift.tt/2rdiq5W

Submitted May 17, 2017 at 12:19AM by _bit

need a nodejs developer to build a tool for me

I have a list of millions of domains i am putting in a database. I require someone to build a nodeJS app to go through this list and check the website to see if it has a SSL Certificate installed on the domain name ( www and non www version of domain), it then needs to get the expiry date, the brand and type of SSL. It then needs to update the database. It will then continue to update the database over time with new information such as changed expiry dates, ssl brands etc. I will also add domains to the list once a month. I will pay based on experience and time you expect to complete the project. I will supply a dedicated VPS for it. We can discuss this via skype anytime to get the finer details. I am doing this to get some statistics for a uni project. I would like it built within the next few days if possible.

Submitted May 16, 2017 at 11:46PM by PixelPaulaus

How do I prevent my API page from being viewed, yet still allow AJAX requests to it?

The code for my API page looks something like this:app.get('/api/users', function(req, res, next) { User.find().exec(function(err, users) { return res.send(users); }); }); It returns JSON data, and then I can make an AJAX request for that data on the front end. But if I got http://localhost:3000/api/users, it shows the JSON data in the browser.Is there any way to prevent this data from being displayed in the browser yet still provide the data for my AJAX calls?I'm using Express, by the way.

Submitted May 16, 2017 at 11:11PM by Torus8

When do I use req.session vs socket.request.session?

I have a single route that executes a python script and stores the stdout in a express session variable. I emit that data to the client, but I am not sure if I when to use socket.request.session or if I even need to use it all. What is the difference between req.session and socket.request.session?Thank you, I appreciate any help!

Submitted May 16, 2017 at 09:37PM by judoka24

How to include non-npm library in project?

This is a Tooltip library I would like to use:http://ift.tt/2pHk5ko there is no NPM package for it. I have a node/express/webpack project.How can I include a library like this in my project?

Submitted May 16, 2017 at 08:23PM by MonkeyOnARock1

Woodlot - An all-in-one JSON logging utility for NodeJS.

http://ift.tt/2qOe9pY

Submitted May 16, 2017 at 07:47PM by amdsouza92

My little pet project. Can you do some code review?

http://ift.tt/2rn7uix

Submitted May 16, 2017 at 06:15PM by ice2heart

stream consuming pace

Hi,I have a limited understanding of nodejs streams but I'm interested on how the data in each piped "consumer" flows. E.g:loadRemoteFile() .createReadStream() .pipe(progressReportTransformer) .pipe(unzipper) .pipe(someOtherTransformer) Imagine the upper situation where someOtherTransformer might "block" the stream by not calling done asynchronous but waiting for an async operation like creating a database table. It can work because a stream.Transformer can delay the data flow by not calling done() right away.Now is it a problem for the progressReporter, meaning will the progressReporter stream delay reading the next chunk until the one later (someOtherTransformer) in the "chain" finishes it's job?I don't know if I should imagine this process as a synchronous operation where the first pipe in the chain reads data from the readStream and when finishes pushes it/something to the next pipe for processing and this first pipe will only read the next chunk when the last pipe in the chain finished OR I should imagine it as if an intermediate pipe in the chain finished it's operation and pushed it's state to the next pipe for processing it gets ready for another chunk?I don't want my progressReporter to read (and report) faster than my latter async operation finishes it's operation.I hope I was clear enough.Thanks

Submitted May 16, 2017 at 03:41PM by Jim-Y

Mobile App Development: with NodeJS and JSON

http://ift.tt/2qMqzyp

Submitted May 16, 2017 at 10:46AM by snsdental

Is it worth studying Node itself, or Express?

Node has always been a bit of a puzzle for me as I've equated Express to be a lighter weight/less opinionated analogue of Rails or Django for back end Javascript. I'm in the first chapter of "Express Blueprints" and gaining clarity on how the server side works, it even has a chapter on Koa towards the end.I'm just curious if I should also pick up some learning materials on Node itself (I see there are a lot of them, more than Express actually). And if so, what benefit does studying Node itself yield?EDIT: Besides web apps I also plan on making scrapers and bots that run on the server side, which is another reason why I'm wondering about Node on its own and whether its a more suitable foundation for these types of things.

Submitted May 16, 2017 at 11:00AM by seands

Automatically build and publish Node and Electron applications for Linux

http://ift.tt/2qMmcDR

Submitted May 16, 2017 at 09:23AM by codedesi

Chromium DevTools debugger for NodeJS

Simple debugger application with Delphi and Dcef3. It allows debugging NodeJs applications/scripts in similar way you can do it in Chrome. Enjoy.http://ift.tt/2qqqJZt

Submitted May 16, 2017 at 09:55AM by a_domanska

Monday 15 May 2017

Body-parser does not currently export a multipart/form-data-capable middleware ?

Hi guys, as the title says im trying to handle a multipart upload with bodyparser. I can handle the file upload ok, but parsing body data is proving to be 'undefined'. Hoping someone can offer something in the way of advice for this?

Submitted May 16, 2017 at 05:58AM by teflhell

Combining NodeJS server with Jetty Server

I’m making a social media site in NodeJS, because I am familiar with it. But I don’t want to use it for large CPU-intensive computations in NodeJS. I would rather use Java for that. I was planning on using a NodeJS server for all client-server interactions, and then a Jetty Java server in the background for the recommender system and scoring and ranking results (all which require large computations). How should these two servers communicate? Should the Jetty server run on a local port in the background and make the NodeJS server send it http requests?

Submitted May 16, 2017 at 05:24AM by jerryleelewith

How did you learn node?

Hi all,In the last few months I have been teaching myself to code using the odinproject and freecodecamp and am pretty happy with what I have learned so far. I know some standard html, css, and javascript..and have successfully coded a few cool front-end projects like blackjack and other nifty things. The next step for me is to learn node. So far I have been taking a udemy course on it and have learned a lot but it can be quite overwhelming at times. I look at other examples of code and it makes me wonder how you all got so proficient at this. Any words of advice for a beginner?

Submitted May 16, 2017 at 02:25AM by esheena1

How to improve from here?

Hello, i recently did 10 node projects as part of a curriculum, but now that they're over i'm not sure how to improve from here.Here are the projects i've made (the first 10 are using node): http://ift.tt/2rcvA08 , any ideas on what to do from here on? A list of projects would be the ideal type of thing i'm looking for. I've never done something with authentication, password encryption and sessions, for example.

Submitted May 16, 2017 at 03:23AM by Selhar

Sharing/Storing just the diff instead of a full text?

Right now I'm thinking about how to propagate and store changes across clients.For example, if someone applies a 40 character diff to a 20,000 character string:what's a more efficient way to transmit the diff than to send the entire 20,000 character string?what's an efficient way to store the diff (e.g. revision history) than storing the whole 20,000 character string twice?Wikipedia is probably a good example of where more efficient diff storage would be a good idea. They probably store only the final copy and the entire diff history, rather than each history entry being a full copy. I wasn't able to find anything related to this on google.I'm mostly interested in good reading material or npm libraries for this subjects.

Submitted May 16, 2017 at 12:19AM by LeBuddha

Launching Ignition and TurboFan in V8

http://ift.tt/2pDboYe

Submitted May 16, 2017 at 12:59AM by freebit

Ubuntu permission error

When I try to run my he script through terminal I get the following error:Error: EACCES: permission denied, open '/var/www/html/xxxxxxxx.js'I thought my permissions were right but this appears to indicate they are not. I cannot find a solution - this is my first time using node and I'm relatively inexperienced in Ubuntu.Any help would be appreciated - thank you

Submitted May 15, 2017 at 08:45PM by lil_mr_reddit

User authentication passport-facebook in iOS app

So I am wondering what to do with the small API that I have created. In the API I have the ability to login with Facebook. Right now I am doing it stateless as I want to be able to do it on both mobile and web. Therefore it returns a jwt token that the user stores and uses each time he/she calls the API. This work well in a browser and through postman and now I am starting to work with the mobile part. I want to know more about how you implement this into an iOS app. Do you just create a 'fake' button that makes the needed get request, or do you use the FacebookSDK somehow? The logical way for me right now would be the first one, but I am not sure, as I have not worked with this before..Hopefully someone can shed light on this minor headache of mine.

Submitted May 15, 2017 at 06:53PM by lidttilvenstre

Unsplash's photos as your wallpaper.

http://ift.tt/2if6dcQ

Submitted May 15, 2017 at 03:28PM by rawnly

Setting up authentication in Express vs Meteor

Hi,I was looking into studying Express vs Meteor as my 1st back end framework. A post on stack overflow said the additional weight of Meteor gives you faster MongoDB and websocket setup, and hours of time savings with user authentication.I wanted to learn a lighter framework like Express because I plan on making lots of little scripts and bots, so that user auth thing is a bummer. Is there any way to speed up the process with Express using say a 3rd party module (I know nothing about Express right now)?

Submitted May 15, 2017 at 02:36PM by seands

Objection.js ORM

http://ift.tt/1JTRiYI

Submitted May 15, 2017 at 01:56PM by Saltones

A First Introduction to the Node.js Community Committee

http://ift.tt/2rbh09a

Submitted May 15, 2017 at 02:05PM by _bit

The Wonderful and Expanding World of Node.js and Robotics

http://ift.tt/2p9nc2L

Submitted May 15, 2017 at 10:06AM by harlampi

Sunday 14 May 2017

Reddit-snooper, Reddit bot library for Nodejs

http://ift.tt/2rcaoqf

Submitted May 15, 2017 at 06:56AM by juicypasta

Block SQL injections, not your customers

http://ift.tt/2nZOpRG

Submitted May 14, 2017 at 10:40PM by ecares

Deploying Node.js Microservices to AWS using Docker | @RisingStack

http://ift.tt/2qGPVh5

Submitted May 14, 2017 at 09:56PM by pmz

Site Authentication with Node [Video Series]

https://www.youtube.com/watch?v=CqQMfCzyx08&list=PLSpJkDDmpFZ4P0Ont_VBj1uh9DGniSc8b&index=1

Submitted May 14, 2017 at 06:06PM by eXtremeRR

Why would you use a reverse proxy for Node?

I hear that putting your Node service behind something like nginx's reverse proxy helps mitigate attacks. Can anyone give me examples of security risks that this would prevent? Thanks!

Submitted May 14, 2017 at 02:26PM by loftyal

Using Docker Compose for NodeJS Development - via @codeship

http://ift.tt/2r1Y3Gc

Submitted May 14, 2017 at 03:14PM by harlampi

Express middleware to protect against XSS & SQL Injection

http://ift.tt/2qf8GY2

Submitted May 14, 2017 at 11:24AM by gergelyke

Saturday 13 May 2017

I get an error only when I set a breakpoint or step through in this function

http://ift.tt/2rdg3MY line 15 if I set a break point and debug, theList becomes undefined for the next statements and I get an error.However if I don't set any break points or don't step through it, there is no error.I think this might be a node related bug and not a code related but maybe I'm wrong?I am using vsCode to write js and launch node debugging.

Submitted May 14, 2017 at 02:46AM by BigglesWerth

What's a good open source RESTful microservice to use as a reference.

I am looking to restructure one of my companies micro services that utilizes Node, Express.js, Swagger docs and TypeScript. The microservice is basically just a compilation of REST end points for making calls against our MySQL database. Looking for a good example of project structure and coding practices. Obviously if the app is more robust than just that, I can still take a look at it and pick apart the things that matter for my work. Thanks!

Submitted May 14, 2017 at 02:53AM by TovrikTheThird

Is it possible to compile a js file?

I understand that node.js is an interpretator, so it means it reads every line at a time instead of turning it all into maching code. But I know there are a few modules that can turn it into an executable. Has anyone had experience with any? If so what is the best one and does it also deal with modules that your code is using?---EDIT--- If you can't compile it, is there a way to "lock the source code" so if you were to give it to someone they couldn't see any of the written code or a way to stop the user for editing it?

Submitted May 13, 2017 at 11:44PM by nightfuryninja1

Do I need to use Nginx if I am using AWS ELB?

I am trying to deploy a simple node.js app to AWS EC2 using auto scaling and load balancing. Is there any need to use NGINX if I use a load balancer and PM2 to keep it running? Would I still need to reverse proxy to my instances?

Submitted May 14, 2017 at 12:53AM by poethetortoise

What data structures should I know for Node

What data structures are useful and necessary to know for efficiently using Node. So far, I know Linked Lists and Recursion.

Submitted May 13, 2017 at 11:58PM by T-Dot1992

While working on an Electron app on macOS I wrote a couple useful modules for working on macOS

Three modules, actually:osxsleep: You can register a callback in Node to get notified about a Mac's sleep stateosxreachability: Based on Apple's Reachability example code you can register a callback to get notified whether the Mac is connected to WiFi/LAN or not connected at allosxaudioswitch: Makes it possible to switch the output audio device from NodeAll modules are, with their respective names, available via npm.Maybe someone finds some use for them besides me.

Submitted May 13, 2017 at 10:54PM by FedExFacto

Free and Open-Source Slack Alternative written in Node.js / Total.js

http://ift.tt/2q0b96E

Submitted May 13, 2017 at 08:55PM by petersirka

Keeping the Node.js core small – Node.js Collection – Medium

http://ift.tt/2q5qtk0

Submitted May 13, 2017 at 05:52PM by r-wabbit

Reddit-snooper a reddit bot framework for nodejs

http://ift.tt/2rcaoqf

Submitted May 13, 2017 at 06:14PM by juicypasta

Express static file routing

I have been trying to search the proper way to solve this problem, but have had no luck. I am trying to get express.static to point to the same directory, completely ignoring what's happening in the requesting URL. My directory is structured like so:views --view1.hbs --view2.hbs --etc... public --css --main.css --js --main.js --images --bunch --of --images My current static route is set up like so:app.use(express.static(path.join(__dirname, 'public'))); And for routes which come from the root directory, this works as expected. So for example:http://mysite.com/home http://ift.tt/2r4jRnn As soon as I start to add another level to the url, this breaks down. For examplehttp://mysite.com/archive/2 Routes incorrectly to/public/2/folder/resource.xxx Instead of/public/folder/resource.xxx So how do I setup my static file router so that a url such ashttp://mysite.com/any/number/of/levels/into/infinity Always serves static resources from the public folder route directory? I'm pretty new to building this kind of application, so any guidance is appreciated.

Submitted May 13, 2017 at 03:36PM by saabstory88

Friday 12 May 2017

The Post JavaScript Apocalypse - Douglas Crockford

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

Submitted May 13, 2017 at 03:14AM by fagnerbrack

Full-stack Node.js web diagnostics

http://ift.tt/2pZBSAo

Submitted May 13, 2017 at 03:46AM by hbakhtiyor

recommendations on scalable video upload implementation

We currently have a node based system that enables upload of large video files (500 mb and up). The video stream is passed to the server and streamed directly to s3. However, our solution is not scalable as the streams require too much CPU. I am looking into browser-based uploads directly to s3 but still investigating securing issues. There is also the possibility of setting up a separate uploading server for handling uploading requests.Does anyone have recommendations on solving file upload scalability problems with node?

Submitted May 12, 2017 at 10:12PM by bipipi

Node/Express library for building text-only UIs (TUIs)?

Does anyone know of a library that can be used to build text-only graphical environments like Lanterna for Java or Curses for C? Thank you!

Submitted May 12, 2017 at 08:25PM by rayrack

A rival to Protobuf!

http://ift.tt/2pH1Wz8

Submitted May 12, 2017 at 07:41PM by fed135

Run promises in parallel with a concurrency limit

http://ift.tt/2e68R0M

Submitted May 12, 2017 at 06:54PM by sindresorhus

Flat node dependencies

http://ift.tt/2r6oaec

Submitted May 12, 2017 at 04:43PM by robertkrahn

Distributing a self-replicating malicious code using NPM

http://ift.tt/2qAxzyp

Submitted May 12, 2017 at 05:14PM by gajus0

Can you use passport.js with a hardcoded user/pass?

Say I wanted something similar to htpasswd/basic-auth.

Submitted May 12, 2017 at 04:09PM by mineralwatersoda

Update Node.js and NPM to latest version in 4 Easy steps

https://twitter.com/paulinawilson82/status/863034326593675264

Submitted May 12, 2017 at 03:14PM by PaulinaWilson

Developing Microservices - Node, React, and Docker

http://ift.tt/2qdd0VX

Submitted May 12, 2017 at 02:30PM by michaelherman

ES2015 to Golang transpiler (x-post from r/golang)

http://ift.tt/2qxK8e3

Submitted May 12, 2017 at 02:01PM by hbakhtiyor

Assign a unique id to logs related to same request

I am using winston to log my things in my application.I would like to be able to insert a unique ID to each log related to the same request so that I can easily extract and analyze the logs for a single request, otherwise it happens that they get interspersed and it is really hard to go and see what happenend.How could I do this?http req1 -> log_id1 http req2 -> log_id2 [...]so I could get something like:log_id1: processing headers log_id2: processing headers log_id2: parsing log_id1: parsing log_id2: evaluating expression log_id2: calculating result log_id1: error, field not found

Submitted May 12, 2017 at 02:03PM by honestserpent

An Abridged Cartoon Introduction To WebAssembly

http://ift.tt/2r5a8dy

Submitted May 12, 2017 at 10:33AM by a0viedo

Starter Files + Stepped Solutions for the Learn Node course

http://ift.tt/2pZ0efB

Submitted May 12, 2017 at 09:37AM by mmaksimovic

Node.js Weekly Update - 12 May, 2017

http://ift.tt/2q8oOKV

Submitted May 12, 2017 at 09:25AM by hfeeri

Got stuck in an airport, so I finally had time to create a Sails.js todo list walkthrough. Would love some feedback :)

http://ift.tt/2r8aJep

Submitted May 12, 2017 at 07:43AM by matthova

Best way to extract a block of HTML from a string of HTML?

So, for example, I have a string that represents an entire HTML page. Could be a couple of MB worth of HTML, this is complex dynamically rendered HTML.inside this block, is a single block. It could be quite large, or small, depending on the HTML in question. The Table will have a specified id="resultTable" on the tag.What's the best approach to extract the FULL content of the table, as HTML. I need the to tags to come back as a complete string, not just the content/information in the cells, which will then be further processed.Anyone done something similar?Thanks,

Submitted May 12, 2017 at 07:29AM by VIDGuide

Thursday 11 May 2017

Learn Restiful API basics by implementing one using nodejs and express

http://ift.tt/2q70ysD

Submitted May 12, 2017 at 12:15AM by francishero

Cross post from /r/webdev - group buy for that JS course!

http://ift.tt/2q82wZi

Submitted May 11, 2017 at 09:00PM by dadaddy

What's the best way to load assets in staging/production environments with nodejs?

I'm going to start a new nodejs application and I'm not sure what approach to choose to load my js/css files on staging and bundle them to production.In my work, we have an app that is setup like this:/config/all.js: this file contains arrays with filepaths. Different arrays for lib assets and own assets. This means that everytime a new file is added, I need to include the filepath on this file.In my footer.jade:if (process.env.NODE_ENV == 'development') for jsFile in jsFiles script(type='text/javascript', src=jsFile) else script(type='text/javascript', src='js/application.min.js')where jsFiles is the array with all the javascript filepaths the app has to load. In staging environment, we run grunt build so grunt takes care of concatening and bundling all assets. We're not using ES6 import.Is this a good approach to this problem? Should I be using webpack (though I'm not 100% sure what it is yet) or something?

Submitted May 11, 2017 at 08:06PM by pietrofxq

Is it possible to create an entire website in node.js?

Hello, I was wondering if it was possible to create an entire website in node.js? If it is possible what are the modules I would need to create one and any guides/videos?

Submitted May 11, 2017 at 04:36PM by nightfuryninja1

[SPECIAL LAUNCH PRICE] Learn to build applications and APIs with Node.js

http://ift.tt/2pBaSW2

Submitted May 11, 2017 at 02:29PM by gdangelo

TC39: Open and Incremental Approach Improves Standards Process

http://ift.tt/2oE6YzM

Submitted May 11, 2017 at 12:57PM by fagnerbrack

Why Koding switched from Node.js to Go

http://ift.tt/1IOIeEP

Submitted May 11, 2017 at 10:51AM by Saltones

Writing Secure Node.js Code - Danny Grander (prezentation & transcript)

http://ift.tt/2pApJQi

Submitted May 11, 2017 at 09:47AM by hfeeri

Wednesday 10 May 2017

Stack Overflow Trends

http://ift.tt/2qXSEjt

Submitted May 11, 2017 at 06:28AM by ratancs

Interactive Mind Map for learning anything

http://ift.tt/2mSCWqf

Submitted May 11, 2017 at 06:34AM by ratancs

Learn and master GraphQL by building real web apps with React and Node

http://ift.tt/2pziKbq

Submitted May 11, 2017 at 03:56AM by VINTOROT

Processing Data

I have a couple of CSVs that are very large (several gigs each) and would like to compare the data between them to consolidate any matches.What is the least expensive way to iterate and compare the values between these large files? My first thought was to use redis and load in the smallest csv, then compare each chunk of data to the redis database but is there a better way?I would like to fork this process into clusters to process them all in parallel if possible.

Submitted May 11, 2017 at 02:03AM by Midicide

Why is this function returning undefined?

I have a function like so:var checkStripeId = function(brand){ var isConnected; var GameScore = Parse.Object.extend("Brands"); var query = new Parse.Query(GameScore); query.equalTo("ownedBy", brand); query.first({ success: function(object) { // Successfully retrieved the object. var test = object.get("stripeUserID") isConnected = Boolean(test); console.log(isConnected + "success") }, error: function(error) { isConnected = false; console.log("err") console.log("Error: " + error.code + " " + error.message); } }); return isConnected; }; I call it like so to see the result: console.log(checkStripeId(user)) This is returning Undefined

Submitted May 11, 2017 at 02:15AM by farhansyed7911

Queue of hashes sorted by id and backend by redis

http://ift.tt/2qUoq3G

Submitted May 11, 2017 at 12:34AM by indatawetrust

What are some good tutorial sites for node?

Hey – I'm trying to compile a decent list of sites that have tutorials for node and node-based services.More general sites like https://scotch.io and https://airpair.com as well.What are some of your favorites?

Submitted May 10, 2017 at 10:29PM by Nimsical

There's no good reason to use Nodejs - UPDATE

http://ift.tt/2r3cE4f

Submitted May 10, 2017 at 09:57PM by bysin

In need of some help in relation to authorization with JWTs / Passport.js

I'm currently doing a hobby project for a friend which involves a custom CMS and a front-end server to serve the data. I've posted on here before but after two weeks of struggling I've not advanced too much.On the back end I've an express server running an API for the blog, users and other schemas.On the front-end I've an express server that serves the pages using the templating engine handlebars.Currently I've managed to authenticate users to the API using Passport and JWT, on login I'm storing a JWT with permissions in the cookie storage within the browser (no localstorage access as it's not a SPA)My issue is that I am struggling how to implement authorization on the client end for access to the admin panel.Should I decode the JWT on the client-end and read the user role then serve the pages if the admin pages if the user is an admin or should I be sending every request to access the admin section of the front-end to the API for a verification check then serve the page on the front end if the check passes.I realise this would have been much easier if I had just combined the front-end and back-end into 1 app but I was looking at trying to separate them as I've read it's a better practice.Any help would be greatly appreciated, thank you.

Submitted May 10, 2017 at 08:46PM by wires55

Visual Studio for Mac | Visual Studio

http://ift.tt/2fXzIyl

Submitted May 10, 2017 at 07:14PM by ratancs

Keep getting odd error

Building a Realtime Chat With Next.js and PubNub

http://ift.tt/2qPE0NH

Submitted May 10, 2017 at 05:08PM by code_barbarian

How to read big json file?

I have a json file of ~500mb, containing only one big array of numbers. And I want to read that file to use the array in a program. How do I do? I can't use fs.readFileSync because the file is too big. I have googled a bit, and I found how to read each line induvidually, but everything is in one single line.

Submitted May 10, 2017 at 05:12PM by CMDJojo

How do you deploy? Docker? Strong-pm or pm2? Do you SSL?

Hi all,I'm transitioning toward node on backend and I find myself a little lost when it comes down to deploying.I came to appreciate the usefulness of docker, I tried pm2 and strong-pm, but I still fail to see an organic ecosystem.For example, pm2 doesn't work dockerized, strong-arc is being slowly pushed out by the new "restyle" by IBM (they blocked the registration form so I cannot register to use strong-arc), etc..In all this I would need SSL protection (https) on my connections but I'm struggling to understand how to manage that with docker on a custom port.Suggestion? notes?How do you deploy your (backend)apps?Are pm really useful?Do you use ssl? how?

Submitted May 10, 2017 at 04:08PM by ThrowAwayAcc_YSK

5 best Node.js app examples

http://ift.tt/2qZI1eU

Submitted May 10, 2017 at 02:18PM by GabriellaSaybert

Node documentation created and edited by the Stack Overflow community

http://ift.tt/29XWQrA

Submitted May 10, 2017 at 11:57AM by goods_and_services

Auth0 or passport?

So I want to setup authentication for the first time for my todo-app. The common strategy seems to be between cookie + session vs json web token. And I'd like to try jwt first.My question is do I roll with passport or auth0(I have to pick one to start with)? Despite all similarity, which is more friendly or just you prefers?

Submitted May 10, 2017 at 10:56AM by FateRiddle

How Sockets Can Block Node’s Event Loop

http://ift.tt/2pi2fCW

Submitted May 10, 2017 at 09:55AM by ms-maria-ma

Tuesday 9 May 2017

There's no good reason to use Nodejs

http://ift.tt/2pntkBj

Submitted May 10, 2017 at 06:54AM by content-type_geek

If you're interested on how to use the new Chrome headless over PhantomJS that everybody is talking about lately, check here

http://ift.tt/2po2pIC

Submitted May 10, 2017 at 03:19AM by fagnerbrack

Data security in NoSQL databases

I've heard that data security is quite weak in NoSQL. Is it safe for apps with credit-card transactions use NoSQL?For example, in online games, if I purchase "in-game money" through real money. The data would probably be stored in the games' server database. Would it be safe to use NoSQL for this case?Same idea with Uber for drivers, they store the "money you earned" in a database and then deliver that money to you every few weeks. Would it be safe for Uber to switch to a NoSQL database? Currently they are using MySQL.

Submitted May 10, 2017 at 12:22AM by badboyzpwns

I'M BACK!! (NOW...LET'S GET DOWN TO BUSINESS!!)

https://www.youtube.com/attribution_link?a=GF24d6thsq8&u=%2Fwatch%3Fv%3DpvFjvjQKy88%26feature%3Dshare

Submitted May 09, 2017 at 08:05PM by Sweet_SpiritofLight

Recursively create directories - A better mkdirp

http://ift.tt/2qWljEo

Submitted May 09, 2017 at 08:33PM by sindresorhus

Have we passed peak Meteor already or is this just a momentary drop in interest?

http://ift.tt/2q12sem

Submitted May 09, 2017 at 08:14PM by lemondeCello

Project to Backup Cloud Services

Something I've become increasingly worried about - and perhaps I'm paranoid - is losing data I have in the cloud to ransomware, lockouts by the service, etc. Therefore, I've been putting a little bit of free time into writing a service in Node.JS that will back up the data from cloud services I use such as Dropbox, Gmail, etc and store them as encrypted archives.I've made considerable progress on the core backup utilities, and now I'm working on the user interface and documentation. Is anyone interested in collaborating on this project?

Submitted May 09, 2017 at 05:53PM by johnjones4

FTP?

Hey all,wondering if anyone has used or can point me to a up to date ftp module? I've been looking around but all the ones I've seen haven't been updated in 2-3 years.I need to upload a file via ftp.Thanks

Submitted May 09, 2017 at 05:34PM by gander_7

Debugging Node.js with Chrome DevTools

http://ift.tt/28W6hZL

Submitted May 09, 2017 at 03:39PM by ratancs

Project Glimpse · Full-stack Node.js web diagnostics

http://ift.tt/2pZBSAo

Submitted May 09, 2017 at 03:06PM by ben_a_adams

Node.js Post-Mortem Diagnostics & Debugging

http://ift.tt/2pWKo4A

Submitted May 09, 2017 at 09:01AM by hfeeri

[Hiring] Node.js API developer in Salt Lake City, UT

My team is looking for a decent Node.js developer. We do MEAN stack, except there is no Angular work to be done for this position. There is already another team of Angular developers that handle that. This is specifically a back-end position.Since I am posting this on /r/node, I'll give advance notice that I have no clue if my company would pay for relocation or sponsor a work visa or would hire a remote person. Ideally, if you're already thinking of moving to Utah for job opportunities or you already live in Utah, and you're a great Node.js developer, this might be of interest to you.Please send me your resume if you're interested and check out my other post on this job opening. Also, ask any questions about the job, company, culture, technologies used, etc that you'd like to know more about.This is an X-POST from /r/utahjobs. See http://ift.tt/2qV2Vg2 for more details. Also, the company's official job posting is at http://ift.tt/2ptIlCr.

Submitted May 09, 2017 at 05:23AM by daniel_mcq

Good REST Backend with Admin UI

I'm building a site, and I'd like to focus on the frontend development. I'm looking for something SQL-based like WordPress or Ghost where I can give my client a perfected admin panel to add/manage content. I will then access that content via a REST API.I looked into Ghost, but there was no clear way to add custom fields/metadata to a post like you might be able to with a WordPress plugin. I looked into Directus, but the Node-based version is still being developed (I'd like to avoid PHP).Does anyone know of a database manager/CMS/REST API panel that I might be looking for? Admin panels always take way too long to develop ion relation to the rest of the site.Edit: what I think I'm looking for is a headless CMS

Submitted May 09, 2017 at 05:37AM by DaAwesomeP

Monday 8 May 2017

Why cookie needs a session?

Hi everyone, I'm reading jwt vs cookie authentication(both never done or use before). I understand jwt is sent in every request and contains all the user info, so there's no need for a session. But, why does cookie need a session? It seems to work extremely like jwt, as it is also include in the request header every time.Is it that jwt stored everything and pass it around, cookie stored key information and session stored the rest on server?

Submitted May 09, 2017 at 03:19AM by FateRiddle

Compile JavaScript? Really?

http://ift.tt/2pebXI5

Submitted May 08, 2017 at 11:50PM by coldlinecall

Anything like Electron but without the DOM?

Just curious if this exists for nodejs.

Submitted May 09, 2017 at 12:18AM by LeBuddha

Why are NoSQL databases usually paired up with Node?

I've been doing some research for databases for Node.JS and almost everyone is recommending NoSQL type databases, like MongoDB.I see that NoSQL is not that great for relational data, but that's where I'm getting confused: Most business applications (or social networking type apps) have relational data. For example, let's say I'm building an application in Node.JS for a school that has students, teachers, classes. You can see there's alot of relationships in there.Would you recommend using NoSQL? I know that you can use mongoose to enforce relationship databases in NoSQL databases though. Or would you go for a SQL database? Why does the majority recommend using NoSQL when using Node?

Submitted May 08, 2017 at 11:42PM by badboyzpwns

Announcing the new Webpack CLI

http://ift.tt/2psjPBI

Submitted May 08, 2017 at 09:56PM by _bit

Wes Bos - Learn Node

https://learnnode.com/

Submitted May 08, 2017 at 07:45PM by maxwellsmart84

How do I check a variable's type?

Sorry for the basic question. I used to be java programmer so I'm not familiar with var-type variable in javascript.So I'm using loopback for coding back-end middleware. There a variable named context that I have no idea what it is. And it's hard to search the documentation since variable named 'context' are used in multiple hooks and each of them are different. Is there a way in nodejs to list all the variables and possible method of an object?

Submitted May 08, 2017 at 06:18PM by zeedware

There's no good reason to use Nodejs

http://ift.tt/2pntkBj

Submitted May 08, 2017 at 05:22PM by bysin

Promises, Refactored.

http://ift.tt/2pKvxKq

Submitted May 08, 2017 at 01:07PM by mhellerogden

Why there is not so much information about node.js streams?

I wrote an article about the node.js streams. I believe the topic has not enough attention in node.js world. Why is it happen?

Submitted May 08, 2017 at 01:33PM by kharandziuk

A Powerful and Flexible ORM for TS/JS

http://ift.tt/2hnsscY

Submitted May 08, 2017 at 02:17PM by hbakhtiyor

Mongo Gone Zalgo (WTF Node)

http://ift.tt/2pY6fqN

Submitted May 08, 2017 at 02:17PM by pongfonge

Where to go after an udemy course?

Where to go from here? There is a lot of other node courses in udemy but they are beginner focused. Where can I find intermediate material?This is the one I took: http://ift.tt/2pnfoqW you

Submitted May 08, 2017 at 02:33PM by UmNomeUnico

If I migrate over to Node.js from Wordpress, will my SEO be negatively affected?

I'm speaking with several different development companies and I'm being told that by moving to a custom web application using node.js or a MEAN stack, would negatively hurt my SEO and is not worth it.Are they right? Or are they just being lazy?

Submitted May 08, 2017 at 02:39PM by ineedhelpcoding

What's the best way to cache session data in Node?

Our app (Node / Express) has some data that is generated during a user session, and we need to have quick access to it. I was wondering what the best way to do this might be.For more detail:The initial data is requested from an external server, then processed. It is this processed result that we must store as long as the user's in session.Data size should be about 10kb of size per user on average, 25kb per user tops. Hopefully one day we'll have hundreds or thousands of concurrent users, so it'd be great to design with that ambition in mind.We need very quick access to it - we might want to feed it back to the user dozens of times per session.It definitely needs to live in the server and not in the client, as it is used in processes there.We might want to store it into a database some day after the session has ended, but for now the priority is to have something that is only persistent for the duration of the user session.I have explored a couple options, including:express-session + Redisnode-cacheI am still a beginner so there are some questions you might be able to help me with:What's the best method in your experience? Any obvious ones we've skipped? Any trade-offs we should be aware of?Why is Redis such a popular system for this? In my novice mind this seems like a rather simple operation (just write some data to system memory, and delete it on certain conditions), so I'm wondering why one would layer another system into their stack, instead of simply reading and writing from/into memory with the help of a package.Thanks in advance for your help.

Submitted May 08, 2017 at 12:29PM by no_pants_gamer