Tuesday 31 January 2017

Using Let's Encrypt with Express

http://ift.tt/2kf9ZkM

Submitted February 01, 2017 at 05:09AM by YashdalfTheGray

I Wrote an Iterator-based Utils Library, Looking for Feedback

Hey all,The iterator adapter pattern is common in C++ and Rust so I figured I'd try to bring it all to Node.js.docs: http://ift.tt/2jUgVoV's published on npm as well so you can also just npm install throost and play around with it.One thing I didn't know how to do was alter the CSS of jsdoc's output or get custom CSS on GitHub pages working. If someone can help me fix the CSS in the docs, that'd be appreciated.But I'm also just curious what people think of the library itself. Any feedback is welcome.

Submitted February 01, 2017 at 04:55AM by ExBigBoss

/r/WebdevTutorials - a new subreddit, our goal is to collect the best learning resources for Web Developers.

http://ift.tt/2jO2OPC

Submitted February 01, 2017 at 04:55AM by logandice

Node as WebRTC proxy/edge server: How should I distribute peers between processes?

I'm in the process of writing a browser/javascript client MMO. To improve performance on bad networks, I'd like to use WebRTC datachannel. Specifically, I'm working on running a series of "edge server" processes which will act as UDP/WebRTC proxies. The purpose of an edge server is to insulate the user-base from widespread failure, so if a user decides to do a denial of service attack to his own connection, the entire user-base isn't affected. Due to consistency/security concerns, the architecture is not peer to peer, but only client-server/server-wins. (Please don't ask me why I'm not using peer to peer -- because WebRTC.) How should I apportion the server-side WebRTC peers to Node processes? Do I want to have a whole lot of connections/peers per Node process, or just a few? What is the memory overhead of a Node process running an Express web app server with a small REST API?My current server is configured to handle around 560 simultaneous clients.

Submitted February 01, 2017 at 03:19AM by stcredzero

What to use to send data back to browser for AJAX call

I have an AJAX call using express and jquery on the front end, it saves a field to an array in my Mongo db and that works. However I cannot figure out how to send the data back to the AJAX call to populate the page.It does however output that res.send and takes over the page with the output object. Do I need to wrap that res.send in something or is that the wrong method to use?Here is my node route:router.route("/user/categories/:id") .all(function(req,res,next){ console.log("I see the Ajax request Here"); isLoggedIn; next(); }) .post(function (req,res){ console.log("AJAX call Hit the server here now"); User.findByIdAndUpdate(req.user.id ,{$push: {categories: req.body.user.category}} ,{save: true, upsert: true, new: true} ,function(err, category){ //Need to return categories to the front end res.send({category}); }) }) Here is my AJAX:$("#add_category_button").on('submit',function (event){ event.preventDefault(); event.stopPropagation(); var thisForm = $(this) ,term = thisForm.find("input[name='user[category]']").val $.ajax({ url: $("add_category_form").attr("action"), type: "POST", contentType: "application/json", data: JSON.stringify(thisForm), dataType: json, done: function (result) { alert("successful"); //console.log(result.categories); }, fail: function (fail){ console.log(fail); } }); }); I would think the Alert would trigger, but it does not.

Submitted February 01, 2017 at 03:47AM by illcrx

Authorized Resources and Database Migrations with Strongloop's Loopback (also some docker)

http://ift.tt/2kdKQqO

Submitted January 31, 2017 at 08:46PM by pipituu

Request body weird characters

var request = require("request"); var url = "http://ift.tt/1KThlkf"; request(url, function(error, response, body) { console.log(body); }); On my ubuntu machine I get�+��O��% And on my PC (windows) I get{"success":true,"lowest_price":"$6.38","volume":"2,370","median_price":"$6.97"} What's the problem? I'm sure it worked before..

Submitted January 31, 2017 at 08:54PM by lamerqo

Detect and Blur Faces to Create a “Guess Who” Game with Node.js and React

http://ift.tt/2jrata9

Submitted January 31, 2017 at 05:08PM by bstachenfeld

Node.js security: my articles on Sqreen’s blog (and others)

http://ift.tt/2jz86gF

Submitted January 31, 2017 at 03:56PM by ecares

Node by Numbers 2016 — NodeSource

http://ift.tt/2kcH0hv

Submitted January 31, 2017 at 02:45PM by _bit

Would Node.js be the IE6 of server-side JavaScript?

http://ift.tt/2jQFD73

Submitted January 31, 2017 at 11:47AM by php03

CQRS (Command Query Responsibility Segregation) Explained

http://ift.tt/2jpNtIJ

Submitted January 31, 2017 at 11:09AM by hfeeri

Why The Hell Would I Use Node.js? A Case-by-Case Tutorial

http://ift.tt/1SAPICC

Submitted January 31, 2017 at 09:10AM by php03

Node.js v7 Beta Brings Canary in a Gold Mine

http://ift.tt/2dqq1az

Submitted January 31, 2017 at 08:34AM by joey_php

The simplest, fastest way to get business intelligence and analytics to everyone in your company: build with nodejs

http://ift.tt/1OSCyOZ

Submitted January 31, 2017 at 07:48AM by ratancs

Monday 30 January 2017

I'm having huge problems try to emit messages to a private room with socket.io and redis pub/sub.

So I'm building a facebook like private messenger. I've been trying to accomplish this for more than a week now. I feel like I'm a few lines of code away, but I'm flat out stuck and spinning my tires.Essentially, I'm having problems emitting messages to a private room. I have it so it console logs out what room I've joined, as you will see below, but I can't for the life of me get it to only send the message to the client in the same room. I've had so messages duplicate, or even triple how many times it's sent depending on how many users are using the messenger.I've had the following 2 functions work, but now all of the sudden don't. Both of these were creating duplicates and now don't work at all: socket.broadcast.in(data.room).emit(channel, data); socket.to(data.room).emit(channel, data);This still will emit messages to all clients though:socket.emit(channel, data);Here's my client:` var socket = io.connect('http://localhost:3000'); socket.on('message', function (data) { //Just console the message and user right now. console.log(data.message+" " + data.user); });`Here's my server: Here's a link to the server. I tried multiple times to format this, but can't get it right.I've already asked a question about this on stacks. Note, I'm also using laravel on the backend. I'm pretty positive that this isn't a Laravel problem though. Here's the repository for this project.I'm more than happy to gild anyone that provides me an answer. This question is literally stopping me from finishing an entire project. Thank you all for your time.

Submitted January 31, 2017 at 06:01AM by corbinthecoder

Sequelize migration/model CLI workflow question.

There isn't a ton of information in the docs on the use of the CLI with regards to migrations. From what I can gather, it goes something like this:Use the CLI to automatically make as fleshed out a migration as possible. And as flashed out as possible seems to be essentially just the column names. I haven't found a way to add more properties to the columns, such as default values or associations, from the CLI.Get a timestamped migration and a model which includes a partial database schematic pertaining to that tables columns and associations.Go in and redundantly add all the properties you need, such as associations, default values, allowNulls ect..., to both the model and the migration.Because of step 3 I think I've got this wrong. There is so much redundant code there. I think about how Rails does this by the migrations automatically generating the corresponding schema and I think that this has got to be sort of similar in its best flow. But I'm super green and not exactly sure how it works. Thanks!

Submitted January 30, 2017 at 11:20PM by coderbee

CSS and Javascript files being blocked due to MIME type mismatch

First off, I'm sorry for posting here. But I'm running out of places I know of where I can ask for help. If I'm posting this in the wrong place, I'm sorry, and I would be greatfull if you could point me somewhere where I can post it.I have been getting this error of The resource from “[URL and name of file]” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff). for all of my CSS and Javascript files.The setup I currently have is a node.js server using Express and Express-Handlebars for routing and templates. I'm sure the issue is down to my routing of files which would have requests of dealing with routes like /movies/:id or /search/query:. I have kinda fixed the issue by creating two links to CSS and Javascript files in my main.hbs file (The one which is the default main template), one with a link from / and another for /something/something. Terrible practice I know. But up until now, it worked.But this is why I am asking for help in solving the MIME type mismatch error once and for all. Because when I have uploaded it to my Digital Ocean server, it won't work at all. And I have no clue on how to fix it.My file structure is as follows:/ views/ css/ js/ layouts/ main.hbs index.js In index.js, I have the code to setup handlebars and some code managing CSS and Javascript files.app.engine('.hbs', exphbs({ defaultLayout: 'main', extname: '.hbs', layoutDir: path.join(__dirname, 'views/layouts') })); app.set('view engine', '.hbs'); app.set('views', path.join(__dirname, 'views')); app.use(express.static(__dirname + '/views')); An example of an route would beapp.get('/search/:query', (request, response) => { // Code goes here }); I'm genuinely stuck on what to do. I feel like I have been to all corners of the internet and I cant find any solution to my issue. Its frustrating and bringing me down massively. I feel that there is nowhere to help me. I know there are more important things, but I'm pissed that I can't find anywhere (or anyone) who is having the same issue I have. Let me know If you need any more context.ThanksEDIT I have gotten that desperate, I will give Reddit Gold to whoever will help me fix my issue.

Submitted January 30, 2017 at 11:28PM by McMrChip

Woodpecker - Dismissing Garbage Collection in Node.js

http://ift.tt/2kLKg6G

Submitted January 30, 2017 at 11:30PM by dolftax

I need ideas for web programming project that will look good enough on my resume to land me a job. (crosspost?)

I also made this thread in learnprogramming but maybe this is a better subreddit since it is more concentrated? Anyway...I know some nodejs, mongodb, express, socketio, and of course html/javascript/css.What should I make, or what other framework/tool/??? should I use and put on my resume to land me a job.I've already made a multiplayer game, a bit of a "blog" site, a site for keeping track of personal expenses, and a chat room.

Submitted January 30, 2017 at 09:57PM by JonFrost

A problem with child_process.spawn and git bash on Windows

tldr; Can't get child_process.spawn to work correctly with git bash on windows..Hi all,I am trying to use child_process.spawn to ssh to a server and do some stuff. On Ubuntu i can use the following code:let spawn = require('child_process').spawn; let child = spawn('ssh', ['-tt', 'username@host']); It will open a GUI for the passphrase for the private key and it is all working. I can add eventlisteners on stdout, stderr and write to stdin.On windows with git bash (without node ) i can ssh and it asks for the passphrase in bash (no extra GUI like Ubuntu). When doing it with Node using this code:let spawn = require('child_process').spawn; let child = spawn('path/to/git/sh.exe'); child.stdout.on('data', (data) => { console.log(data.toString()); } // Same for stderr child.stdin.setEncoding('utf8'); child.stdin.write('ssh -v -tt username@host \n'); It will stop with giving data to stdout before asking Enter passphrase for key:. It blocks the stdin and there is no error.Now to the question: Is there something wrong with my code, git bash (probably security things?) or is this bad use of child_process.spawn ?Thanks for reading! Dirkj143

Submitted January 30, 2017 at 07:43PM by Dirkj143

A minimal Markdown editor desktop app based on Electron

http://ift.tt/2cjg9uL

Submitted January 30, 2017 at 05:09PM by amitmerchant

9 Fantastic Utilities for the Node.js Developer

http://ift.tt/2kLEFcw

Submitted January 30, 2017 at 02:45PM by _bit

Expressive ES6 features that shine in Node.js 4.0

http://ift.tt/1Vc28mn

Submitted January 30, 2017 at 10:26AM by avi00

Node.js Version 6 - New Improvements and Features

http://ift.tt/2kJPtMr

Submitted January 30, 2017 at 10:27AM by php03

Time-Travel Debugging for JavaScript/Node.js - Microsoft Research

http://ift.tt/2ju6J2U

Submitted January 30, 2017 at 08:47AM by ratancs

Sunday 29 January 2017

What's the best way to manage environment variables?

I want to be able to set global variables depending on the environment. I want to something like this://config.json if (ENV === "DEVELOPMENT" ) { ENV["API_KEY"] = localGitIgnoredFile["API_KEY"]; } else if (ENV == "PRODUCTION =") { ENV["API_KEY] = herokuEnviorment["API_KEY"]; } I don't know where to begin with this (I'm a Rails guy). Please help. I've just been using a local version of my app and I really need to upload to github and then heroku.

Submitted January 30, 2017 at 06:13AM by pm_me_gold_plz

I've been making JavaScript/HTML5 games to teach myself basic programming principles, but now I really want to learn Node. What's the best way to begin integrating it into the type of projects I've been doing?

I don't want to tackle building a multiplayer game server right away because that seems like a more advanced Node project, and right now I'm honestly not even sure what Node is. I've read some introductory materials but they seemed very focused on the technical side and not on real-world applications. Does Node basically replace all back-end technologies, so the applications go without saying?Would a dedicated high score table be a more sensible first project?

Submitted January 30, 2017 at 05:49AM by Sturgeon_Genital

5 JavaScript Frameworks to Look for in 2017

http://ift.tt/2kqXllO

Submitted January 30, 2017 at 04:17AM by Livelongnstrong

Event Emitters in NodeJs

http://ift.tt/2khDrZP

Submitted January 30, 2017 at 01:17AM by thisdavej

Node based YouTube to gif converter

http://ift.tt/2k6KFxs

Submitted January 29, 2017 at 10:25PM by uttpal25

Telemetry dashboard for node.js apps from the terminal!

http://ift.tt/2dMlGAG

Submitted January 29, 2017 at 08:18PM by ratancs

A Node.js scraper for humans.

http://ift.tt/1pL3Jlz

Submitted January 29, 2017 at 08:19PM by ratancs

Node's framework for interactive CLIs.

http://ift.tt/1jfTvXt

Submitted January 29, 2017 at 08:23PM by ratancs

architecture-free neural network library for node.js and the browser

http://ift.tt/1uxAZs1

Submitted January 29, 2017 at 08:24PM by ratancs

A new, open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript. Powered by node.js and socket.io

http://ift.tt/1zgZORQ

Submitted January 29, 2017 at 08:25PM by ratancs

An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.

http://ift.tt/1GabcP9

Submitted January 29, 2017 at 08:26PM by ratancs

what do you guys think of our new open source project ?

http://www.modulr.io

Submitted January 29, 2017 at 08:29PM by modulr_io

NASA: A web based mission control framework.

http://ift.tt/1XNlHzq

Submitted January 29, 2017 at 08:41PM by ratancs

Managing packages with Yarn

https://www.youtube.com/watch?v=IJdLvCwnpD8&index=1&list=PLtujUkEY1JlppEZrQky2cx0_DL5c0nou0

Submitted January 29, 2017 at 07:41PM by mr_patrick_js

System.import() transformer [Babel plugin] Make your code isomorphic & target any module system

http://ift.tt/2jFJsyz

Submitted January 29, 2017 at 07:15PM by thgreasi

Socky - Realtime application framework using WebSockets/JSONRPC

Hi guys,I'm new to this sub so to introduce myself I'd like to share a project I've been working on recently. Socky is a "framework" for the development of realtime applications (web or otherwise) where client/server communication uses WebSockets.http://ift.tt/2kC3qID repo: http://ift.tt/2kgpRWc repo: http://ift.tt/2kBYu6Q've played around with Socket.io, WAMP, and a few other solutions but never really found any of the currently available solutions to be quite what I wanted.The point of "Socky" is to provide a WebSocket replacement for AJAX calls, and allows for RPC calls to be made by both the client and server.For example://listen for "testmethod" call from server socky.onCall('testmethod', call => { console.log('testmethod called...'); socky.respond(call.id, 'it works'); }); Feel free to have a look at the code and let me know what you think. I'd be happy to hear any feedback and of course welcome any contributions.I still haven't written any docs but I have published it on npm, so you run "npm install socky" to get started and check out the tests to see how to run/connect.

Submitted January 29, 2017 at 05:19PM by lioreshai

Let’s Learn ES6: Setting up ES6 with Node JS

http://ift.tt/2kBtDHx

Submitted January 29, 2017 at 01:09PM by joey_php

The 10 Key Features in Node.js v6 LTS Boron After You Upgrade

http://ift.tt/2eDKKFy

Submitted January 29, 2017 at 11:42AM by php03

That New Node Smell: Node.js Gets Another Long-Term Support Release - The New Stack

http://ift.tt/2efsHdJ

Submitted January 29, 2017 at 10:07AM by avi00

6 of the Most Exciting ES6 Features in Node.js v6 LTS

http://ift.tt/2eRL2uY

Submitted January 29, 2017 at 10:08AM by php03

Saturday 28 January 2017

Rethinking JavaScript: Eliminate the switch statement for better code

http://ift.tt/2k57a5z

Submitted January 29, 2017 at 07:25AM by ratancs

Module for reading Microsoft Word documents?

I'm relatively new to node.js and have been looking for a module that will help parse the content of Microsoft Word documents. My Google-fu is not turning up any one clear option so I was hoping someone would have a recommendation.

Submitted January 29, 2017 at 02:25AM by asgard_fleet

Running multiple servers with one terminal

Hey im fairly new to node. I was curious what the best practice is for running multiple servers via one command/terminal. Basically what i want to do is have 3 node apps (client, auth, and api server) run at the same time but I dont want the hassle of running many terminals. This is specifically for a dev server only.

Submitted January 29, 2017 at 01:20AM by Zalton

I'm really struggling to get node to subscribe to multiple redis channels.

Trying to use Redis and Node together for a socket.io messaging app is driving me nuts. I'm trying to figure out how to use multiple redis channels with node. For some reason I can't even subscribe to a redis channel with any other name then "message". I have also tried to subscribe to two channels at once with no luck. If someone could help me out I would be more than thrilled to gild them for the solution.Here's a stackoverflow question I asked to do with the channel naming problem that contains code.

Submitted January 28, 2017 at 09:48PM by corbinthecoder

How to set up router in NodeJS

http://ift.tt/1VQfPW4

Submitted January 28, 2017 at 06:18PM by shsh3

How to deploy an expressJS application from slack?

Recently i came to know about that we can deploy our nodeJS applications just by entering a command in slack. I am pretty much confused about this and don't know how to do that. I found a blog which does what i want but there isn't technical details in that blog.http://ift.tt/2jh0GU5

Submitted January 28, 2017 at 06:38PM by mehlagaurav

Gulp plugin to show relative path where gulp task breaks.

Any idea of stable plugin which shows the path where there is some error and the gulp task breaks ? Used this (http://ift.tt/2alPMs5) but seems like not compatible with plugins like gulp-uglify

Submitted January 28, 2017 at 03:52PM by jinjamaverick

Saving a socket id to session?

I'm building a simple API using socket.io and express-session middleware, however I'm a bit lost as to how to save each individual socket's id to the session so that I can access it from the request object of any route.What's the best way of going about this so that I can implement, for example, a progress bar on file uploads (I'm already parsing the forms fine and have my back-end emitting on progress. I'm using session-file-store for now if that's relevant.Appreciate the help!

Submitted January 28, 2017 at 12:19PM by ajc820

Friday 27 January 2017

Design patterns and best practices for building scaleable, maintainable and beautiful Node.js applications. Now with website!

http://ift.tt/1B2HEgD

Submitted January 27, 2017 at 09:34PM by ratancs

User authentication options?

So I've been learning Node/Express for a few months now, and I'm starting to feel pretty comfortable. I have no issues writing routers, connected to DB, writing CRUD API's, etc. I can stand up small apps pretty quickly and overall I really enjoy using it for speed and simplicity.Aside from that, I'm teaming with a more Sr. Dev to work on a side project/startup company (hopefully).I've built out the entire API, front-end and everything. He's working on the 'magic' of the app which is way above my head. Recently, I volunteered to take on the user-authentication, which is one of the last steps to get a functioning MVP.The problem is, I haven't really found anything thats intuitive to use. Before Node, I used Ruby on Rails and the Devise gem was like magic. Plug and play - install it and boom, you have a fully built-out user authentication model.Is there anything like that in Node? I've researched Passport and Stormpath. Passport seems a little too complicated being that you have to work with tokens and sessions (which Devise did automatically) and Stormpath is great, but expensive if your app becomes popular, and all the views are in Jade and i'm already committed to EJSAgain, I'm pretty new to Node, so any advice, hints or general direction would be greatly appreciated. I've been working on this issue, trying different things all day and i'm about to pull my hair out so I thought it'd be time to call in the big guns!Thanks in advance!

Submitted January 27, 2017 at 08:38PM by FightArts1

Statistical methods in readable JavaScript for browsers, servers, and people.

http://ift.tt/1D96pjo

Submitted January 27, 2017 at 08:56PM by ratancs

A Node.js module for sending notifications on native Mac, Windows and Linux (or Growl as fallback)

http://ift.tt/1px9RLm

Submitted January 27, 2017 at 08:57PM by ratancs

Scaling node.js REST API server code to production level

I'm building a simple android/ios app that interfaces with a REST api running on my server. This is a financial application and processes credit card info etc.. I chose to write this in node because it's easy to handle, but now that it is nearing completion I notice that each call from the app to the server is taking about 4 seconds on an average and even longer for some others. Assuming that I want to support millions of concurrent users, with this kind of performance already, it would definitely be a horrible experience with even 100 users I presume.The stack is basically a node API running on an nginx webserver that a website is pointing to and the API functions are accessed through this website.So my questions are :Is there an alternative language (Java/Scala) that would offer me better performance? I ask this because node.js is single threaded and maybe using sockets and multiple threads with another language might help me scale better (?)Big companies are using node.js (Paypal/Netflix), how are they able to provide such seamless interaction with incredible response times?Any basic/fundamental principles that I might be missing that is causing this severe drop in performance?In general, if you were building a large mobile based financial application that basically communicates in a regular client-server fashion, what would your technology stack be, to ensure the best possible experience?Any help is appreciated, thanks in advance!

Submitted January 27, 2017 at 06:34PM by zingerburg

I'm going to build a price comparison website with Node.js as the back end. Which framework would you recommend?

The current website is written in Python (Flask framework).The front end does not use a js framework, except for jQuery. I don't plan on using a front end framework like Angular or React. I generally like to keep things simple.I'm looking for a Node.js backend framework that I can be sure will be supported down the line. One thing I love about Python is how mature and well supported the ecosystem is.I also will NOT be using an ORM. I only use raw SQL with a PostgresQL DB.

Submitted January 27, 2017 at 03:51PM by ukfin

How can I install NodeJS through Homebrew?

For some reason, installing NodeJS from Homebrew does not work. What am I supposed to do for it to work? What is the proper way to install it through Homebrew?Thank you!

Submitted January 27, 2017 at 11:42AM by GasimGasimzada

Node.js Weekly Update - 27 Jan, 2017

http://ift.tt/2kskxgi

Submitted January 27, 2017 at 09:54AM by hfeeri

no idea where to begin....need an api for making phone calls and recording them

Any ideas, suggestions? Obviously free is better but I don't think I could make a call for free via a web service. I need to be able to record the duration of the call 2 hours or so each.

Submitted January 27, 2017 at 08:25AM by agentf90

Can you share your projects you built with the Blessed library?

Greetings,I am curious about the possible usages of this library: http://ift.tt/2jXPQj9: http://ift.tt/1ClRtZM

Submitted January 27, 2017 at 07:52AM by mutatednation

Winds is an open source & beautiful RSS reader build with nodeJs.

http://ift.tt/2fHA4He

Submitted January 27, 2017 at 06:23AM by ratancs

Web-based MongoDB admin interface, written with Node.js and express

http://ift.tt/2ca0aSP

Submitted January 27, 2017 at 06:27AM by ratancs

Thursday 26 January 2017

A comprehensive Node.js tutorial for beginners

http://ift.tt/1nflpSC

Submitted January 27, 2017 at 06:16AM by ratancs

Web Crawler/Spider for NodeJS + server-side jQuery ;-)

http://ift.tt/2jDOqJA

Submitted January 27, 2017 at 06:18AM by ratancs

Why are there no good resources for hosting your node application?

I concede I am a noob, but honestly everything I find in regards to running/hosting your node application (just a basic HTTP server in my case) typically directs you to running it on the cloud with services like Heroku. That's dandy and all, but really, I'd prefer to run it on my own machine. This is a small hobby project and I don't need anything extensive. The only other resource I've found was 'iisnode' which looked neat, but it's really designed to be run on a Windows Server rather than a Windows 10 home installation.Of course when I say hosting I imply being able to connect from outside my own localhost. I've never put an application/site into production before so I'm a little lost. Am I just going about this all wrong, or is there really been no good standard in place yet? I would greatly appreciate any help in getting me pointed in the right direction. I'd be glad to clarify and provide any information about the app/my system that would help.

Submitted January 27, 2017 at 12:06AM by j1-gg

Do I have this right? (Origin and relationships between Node, NPM, and frameworks like Express v. other languages)

My noobtalk. Is it right? :In the beginning, there was Node, a pretty neat and popular javascript server with this really cool events loop in it.Then, people started pimping with packages for automation and other bells and whistles.Eventually, npm became a management tool for all that pimping.Finally, frameworks such as Express were built as packages for Node too.So, someone coming from say a Ruby background can think of gems and packages very similarly.One curious difference to me here is that RubyGems is a package manager for Ruby, the language, whereas NPM is a package manager for Node, the server. What's going on there?

Submitted January 26, 2017 at 10:03PM by coderbee

From the node docs on handling request bodies: "We can grab the data right out of the stream by listening to the stream's 'data' and 'end' events." How does the stream know when say the end is not near to designate 'data' instead of 'end'.

from here: http://ift.tt/2a3boWr

Submitted January 26, 2017 at 08:42PM by L000

A Node.js Perspective on MongoDB 3.4: Decimal Type

http://ift.tt/2k6IgVB

Submitted January 26, 2017 at 08:50PM by code_barbarian

I'm a RoR developer who wants to help out a friend with her Node app so I've got to get up to speed very quickly, what would you suggest to get me there most efficiently so I can start helping out? Thanks!

No text found

Submitted January 26, 2017 at 06:10PM by L000

npm for Beginners: A Guide for Front-end Developers

http://ift.tt/2jYwH2r

Submitted January 26, 2017 at 05:51PM by speckz

Does anyone know of a good code review company?

We have two libraries (Ruby and Node.js) which have been developed by our in house development team. As these are going to be launched to the public we wanted to have an external code review - primarily ensuring best practices are followed and that they are free from security issues.Can anyone suggest any companies who offer code reviews for node?Thanks in advance!

Submitted January 26, 2017 at 04:41PM by tyc6

1289 NPM packages that do the same thing (event emitter)

http://ift.tt/2k7oyt9

Submitted January 26, 2017 at 02:31PM by gajus0

I wanna learn nodejs

I have been hearing about node.js and I wanted to start learning it. Anyone know a good source to learn this language? Thanks in advance

Submitted January 26, 2017 at 12:37PM by gabcaraos

'require('../someThing').default' returns?

What does 'require('../someFile').default' return? The require('../blabla') is something similar to 'import' I guess. But what does the 'default' do?

Submitted January 26, 2017 at 09:11AM by TheGermanGuyv1

Wednesday 25 January 2017

Learn You The Node.js For Much Win! An intro to Node.js via a set of self-guided workshops.

http://ift.tt/1GoPNo0

Submitted January 26, 2017 at 06:41AM by ratancs

Suggestions for node chat-app framework?

I'm beginning a little tinkering project. Planning to build a chat app using web sockets (socket.io of course). Just curious if there was a preferred node framework to complement sockets, or if I should just stick with Express as I'm familiar with it.

Submitted January 26, 2017 at 05:15AM by HavenB3

Creating dynamic link by requesting data from front-end in Node.js and Express.js

Can someone help me figure out this problem I am having? I posted this question on StackOverflow but I always get a better answer here from you guys. Question: Creating Dynamic Link...

Submitted January 26, 2017 at 01:13AM by SparkDe

Structuring a node application

edit: referring to api here, sorry for misleading titlei really like the way feathersjs structures services and webhooks, but when it comes to synchronous data calling (fetch a -> fetch a.b -> response.send(a.b)) it fails with complexity. so i was wondering what kind of practices do you use to keep your node applications nice and tidy?

Submitted January 26, 2017 at 01:34AM by syonode

I automated my home with NodeJS, React Native and Raspberry Pi!

http://ift.tt/2kk4Asa

Submitted January 25, 2017 at 10:51PM by deepsyx

How can I help you solve your challenges related to deployment/operations/devops?

Hello everyone, I'm the author of the Passenger application server. We are on a mission to make Node.js development and production, and Unix server tools, easier, more convenient, more robust and generally more awesome.Passenger has been around for a while so we are thinking about what we should work on next. I would like to ask you all, what kind of problems do you encounter when using Node.js, or when dealing with deployment/operations/devops in general, that need solving? Or what do you experience as cumbersome or suboptimal and think needs improvement? How important do you deem those issues to be, and how satisfied you are with existing solutions/mitigations/workarounds for them? Please let me know either by replying here, by emailing me (hongli@phusion.nl) or sending me a tweet (@honglilai).Even if you yourself don't have any challenges or ideas, please forward this message to your friends. I would like to hear their feedback as well!

Submitted January 25, 2017 at 09:54PM by FooBarWidget

Two ways to view all NPM packages installed in node:latest

With this anchore command you can view all NPM packages in your image:anchore query --image node:latest list-npm-detail all You can also see all NPMs installed in your image quickly with this image inspection tool:Anchore.io all NPM's in node:latest

Submitted January 25, 2017 at 08:11PM by weighanchore

Multithreading?

I know "the point" of node is its async, non-blocking events and file system model. However, some tasks (e.g. image processing) require performing many thousands or millions of sometimes complex computations on in-memory objects and does not benefit from this model.Languages like C# allow you to turn for loops into Parallel.For loops which spin off worker threads and handle the gritty parts for you, while allowing complete utilization of an arbitrary number of cores.From a cursory google, node does not have this. There are some libraries on npm for e.g. tasks, but nothing that allows multithreaded computation with resources shared between the threads. Is this possible in node?

Submitted January 25, 2017 at 07:03PM by BDube_Lensman

n – Interactively Manage Your Node.js Versions

https://github.com/tj/n

Submitted January 25, 2017 at 07:36PM by ratancs

2016 JavaScript Rising Stars

http://ift.tt/2iJ4L1z

Submitted January 25, 2017 at 07:00PM by ratancs

websockets+wemos d1+server.js HELP!

Building serverless API with Claudia API Builder

http://ift.tt/2j5klpS

Submitted January 25, 2017 at 04:53PM by ivan_jovanovic

time-tracker-cli released version 2

http://ift.tt/1RTekGS

Submitted January 25, 2017 at 04:10PM by danibram

Spread calls now faster than fn.apply

https://twitter.com/bmeurer/status/824182909317902336

Submitted January 25, 2017 at 03:28PM by a0viedo

an interesting priority queue based data structure called "Israeli-queue" is now available for in-memory use in NPM

http://ift.tt/2koVRZa

Submitted January 25, 2017 at 12:28PM by drora

AWS Lamdba + API Gateway + NodeJS project | FooBar

https://youtu.be/zr7UiwKcf3g

Submitted January 25, 2017 at 01:57PM by mavi888

Chat bot development using node.js

http://ift.tt/2fJ523f

Submitted January 25, 2017 at 01:58PM by slobodan_

webmiddle - Node.js JSX framework for modular web scraping and data integration

http://ift.tt/2jPdo9A

Submitted January 25, 2017 at 12:15PM by Maluen

Build, deploy and manage a Facebook chatbot using Node.js and Cloud 66

http://ift.tt/2j4CtR5

Submitted January 25, 2017 at 12:02PM by Kasia66

Build your own community event monitor (step-by-step guide)

http://ift.tt/2jp98iM

Submitted January 25, 2017 at 11:51AM by Kasia66

Node.js v6 Transitions to LTS

http://ift.tt/2jdRCL3

Submitted January 25, 2017 at 10:59AM by php03

Introducing Node.js 6.0

http://ift.tt/1q9jB1w

Submitted January 25, 2017 at 07:57AM by joey_php

V8 ❤️ Node.js

http://ift.tt/2iHY0Nw

Submitted January 25, 2017 at 06:40AM by fagnerbrack

A book series on JavaScript

http://ift.tt/17F86Fi

Submitted January 25, 2017 at 07:33AM by ratancs

Illustrated Algorithms

http://ift.tt/2k4R383

Submitted January 25, 2017 at 07:34AM by ratancs

Delightful Node.js packages and resources

http://ift.tt/1sGH8TG

Submitted January 25, 2017 at 07:40AM by ratancs

Tuesday 24 January 2017

How to handle simple post request ?

I'm trying to send json to node js server with $.ajax and then save that data to text file from node .What is the correct way to do this from node js side

Submitted January 24, 2017 at 10:06PM by vasifsiz

In Browser Testing in a Node.js World

http://ift.tt/2kpmz40

Submitted January 24, 2017 at 09:21PM by ChrisKingWebDev

Promises are so Passé

https://youtu.be/Hn-gkM0ARZU

Submitted January 24, 2017 at 08:36PM by pimterry

What’s It Like Being on the Node.js Foundation Board of Directors?

http://ift.tt/2ke723m

Submitted January 24, 2017 at 04:34PM by ferrantim

Distributing a self-replicating malicious code using NPM (Security risks that come with highly automated systems)

http://ift.tt/2knSFge

Submitted January 24, 2017 at 03:42PM by gajus0

I started a real-time framework based on Socket.io and Express to keep a tidy logic

http://ift.tt/2knAJ5C

Submitted January 24, 2017 at 02:40PM by manceraio

6 things you should know about Node.js

http://ift.tt/1jubO3q

Submitted January 24, 2017 at 01:14PM by avi00

Robert C. Martin's book “Clean Code” adapted with JavaScript examples

http://ift.tt/2jTYUV4

Submitted January 24, 2017 at 01:05PM by fagnerbrack

9 Famous Apps Built with Node.js

http://ift.tt/2cY2kFD

Submitted January 24, 2017 at 08:20AM by JavascriptFanboy

Looking for motivated individual to learn node with

We can help each other out via bitbucket. Please PM me for further details.

Submitted January 24, 2017 at 08:33AM by haris179

MongoDB Node.js Driver

http://ift.tt/2fBH1b6

Submitted January 24, 2017 at 08:45AM by php03

Monday 23 January 2017

Managing multiple windows with node+electron?

Hey guys, I've been struggling for hours to do this and it's beyond driving me crazy at this point. I'm a node newbie, found electron, and thought a cool way to work on my JS skills in general would be to make an app my gf has always wanted, something similar to the macOS stickies app but in windows. However, I've had a hell of a time wrapping me head around how to make this work in electron, as the only "main" portion of the app should be the top menu bar - there is no actual main windows, just as many stickies as the user decides to add.I did find this module which supposedly makes managing multiple windows easier, but it has led me to nothing but horus of frustration. I cannot even get the simplest main process implementation working. I have two current problems: I can only get the template to show up if I make it the defaultLayout, and no matter what I cannot get the content of the page I'm trying to load into the template's . It doesn't even make sense to me how this module pulls in files or browsers the directory structure at all.Here's my directory structure:app/ css/ img/ js/ layouts/ notecard.html index.html menu.html node_modules/ main.js package.json And my main.js code:// Requires var electron = require('electron'); var app = electron.app; var BrowserWindow = electron.BrowserWindow; var windowManager = require('electron-window-manager'); var mainWindow = null; function createWindow() { windowManager.init({ 'layouts': { 'default': '/app/layouts/notecard.html' } // 'defaultLayout': 'default' }); windowManager.open('index', 'Welcome to this thing hopefully','/app/index.html'); } When I comment out the default layout line, nothing works. When I include it, the layout actually gets loaded (code below):

TESTING TESTING
Hello, may I have a word? Have you every heard about TESTING?

TESTING TESTING
Hello, may I have a word? Have you every heard about TESTING?

No matter what I do, it just displays on the page, and does not pull in any content. Why is this so hard? The documentation makes it seem so easy. What am I doing wrong here to where I basically cannot get anything to work?

Submitted January 24, 2017 at 04:53AM by tangled_up_in_blue

How to send an HTTP response (for example using Express), when a "unhandledRejection" promise error occures?

I'm quite new to Node and I'm currently developing a project using Express.I have to admit I find it very hard to setup error management!Let's say that, during an HTTP request, an error occures inside a Promise (who doesn't make errors?) and the error is not handled properly in the catch block (or a new Error occures in the catch block!).It seems that the mecanism provided by Node to deal with this situation is to add a unhandledRejection global handler:process.on('unhandledRejection', handle(reason, p) { // log the error }); But, in this global handler, we do not have access to the Express's response object so we can't send a 500 error to the client! The request will hangs until it timeouts...The only suggestion I've seen to deal with this is from this thread:app.use(function (req, res, next) { var l = process.on('unhandledRejection', function(reason, p) { console.log("Unhandled Rejection:", reason.stack); res.status(500).send('Unknown Error'); //next(reason); }); next(); process.removeEventLister('unhandledRejection', l); }); What do you think about this solution? Do some of you actually use something similar in production?Otherwise, how do you deal with unhandled promise rejections in your applications?

Submitted January 24, 2017 at 02:05AM by electrotype

ClojureScript framework for Node.js

http://ift.tt/2kkX0Rn

Submitted January 23, 2017 at 09:33PM by yogthos

Want to learn NodeJS from Beginners/intermediate to Advance?

http://ift.tt/2kkfgXe

Submitted January 23, 2017 at 04:28PM by spandey256

Just created a node app to like my friends posts in instagram, you can try it too (to have more time on reddit!)

I have some (really poor I'd say) node.js experience, but feel really enthusiastic about it's async nature.So I'm creating pet-apps like crazy to have more exp. My today's app about instagram auto-likeing. My friends usually whine that I don't "like" their's posts, but the truth is I just don't want to spend too much time in social networks (but still want my friends be happy).So I made this: http://ift.tt/2jicVy0 simple gets the first page of the user you'll tell it and like all posts there. It won't unlike already liked posts though.I set up a free heroku dyno to run this code every hour, you can try it as well (and give me some feedback).Yes, I know there are tons apps like this! But this one allows you to not share your password with anyone (well, besides heroku in case you want to run it daily/hourly).

Submitted January 23, 2017 at 04:54PM by kiote_the_one

Create Profile Pictures with NodeJS, JQuery & Google MDL

http://ift.tt/2jibKyZ

Submitted January 23, 2017 at 04:54PM by ferrantim

Continuous Deployment to npm using GitLab CI

http://ift.tt/2jpro9l

Submitted January 23, 2017 at 04:20PM by ExclamationLabs

The 21 Most Awesome Awesome Lists for Node.js Developers

http://ift.tt/2jJhAaW

Submitted January 23, 2017 at 03:21PM by _bit

NodeJS Development Company | Matrix Marketers

http://ift.tt/2kj891d

Submitted January 23, 2017 at 11:49AM by matrix-marketers

How to Consume a RESTful API Like a Boss Using Node.js

http://ift.tt/2j4wsPt

Submitted January 23, 2017 at 10:46AM by gdangelo

Event Sourcing with Examples - Node.js at Scale

http://ift.tt/2j4cVhV

Submitted January 23, 2017 at 09:37AM by hfeeri

» To Node.js Or Not To Node.js Haney Codes .NET

http://ift.tt/1rztCno

Submitted January 23, 2017 at 08:38AM by avi00

Node.js v6 Transitions to LTS

http://ift.tt/2dMgQyc

Submitted January 23, 2017 at 08:41AM by joey_php

Sunday 22 January 2017

Setup Visual Studio for Node.js Development

http://ift.tt/2jfLntn

Submitted January 23, 2017 at 07:00AM by php03

Nodejs Mysql row count / count(*) example

In this tutorial, You will learn how to count a total number of records using nodejs and mysql. This step by step guide will help you to install mysql module, setup nodejs project and sample code to retrieve mysql table row count.http://ift.tt/2jnpJRk

Submitted January 23, 2017 at 03:23AM by yashwantchavan

Load time when inactive?

Hello from the .net world! One issue .net web apps using IIS face is that when they're inactive, they're slow to load back up. Would an express or koa web app see the same issue? I've been doing a lot of searching, but I'm not finding too many answers. Thanks in advance!

Submitted January 22, 2017 at 10:30PM by CouponTheMovie

I made a module that generates the same container names used in Docker. Very useful for temporarily naming things

http://ift.tt/2k5oVkT

Submitted January 22, 2017 at 08:20PM by TheHeretic

P-Brain.ai: Simple, extendible voice assistant with skills, written in Node.js, which acts as a springboard for developing more advanced AI based assistants like Siri & Alexa. (Now with RaspberryPi support!)

http://ift.tt/2joaTgK

Submitted January 22, 2017 at 06:59PM by patrickjquinn

Why are native ES6 promises slower and more memory-intensive than bluebird?

http://ift.tt/2k4grug

Submitted January 22, 2017 at 03:50PM by Saltones

Building a web service with Node.js in Visual Studio Part 1: foundations

http://ift.tt/2iQnvxW

Submitted January 22, 2017 at 10:51AM by avi00

Node.js Add-On Tooling for Visual Studio - The New Stack

http://ift.tt/1IVkOxK

Submitted January 22, 2017 at 10:53AM by php03

Create REST API on Node.js using Visual Studio

http://ift.tt/2jEo8Yw

Submitted January 22, 2017 at 10:35AM by joey_php

Saturday 21 January 2017

Anyone know of a cli module for uploading videos to a host (like streamable.com)

The to-streamable module is what I want but it doesn't work.Is there another service that allows for video uploading that has a node api? Not looking to youtube.com

Submitted January 22, 2017 at 05:21AM by agentf90

NodeJS Tutorial 2017 A-Z

Guys, I found this awesome nodeJS tutorial if anyone's interestedhttps://www.youtube.com/playlist?list=PLM63DP-1d2SDmwHgbLvg9SMa5OXfm3IZoThere are some other tutorials too

Submitted January 22, 2017 at 03:22AM by comedy247

NodeJS module to check Naughty Strings, it is a set of strings which have a high probability of causing issues when used as user-input data.

http://ift.tt/2iOIRLX

Submitted January 21, 2017 at 10:34PM by redmonks

How is node's documentation?

Simple question.Last time I wrote something with nodejs was over 2 years ago. We had hard time using it and we added some basic modules (http-proxy) to make stuff work. I remember struggling with the documentation.Right now I'm considering using it again for a web application, but my past experience turns me off. How mature are the current NodeJS modules and libraries.Could you compare it against using PHP or Python, in terms of documentation?

Submitted January 21, 2017 at 10:34PM by Filmidra

What's happening behind the scenes with response status 304?

Does the browser cache html and assets, send it to express and does the server determine what's new and not new? And based on that send the appropriate response? Is all of this automatic? I'm trying to understand at what layer, caching occurs.

Submitted January 21, 2017 at 08:15PM by -proof

Best way to implement live streaming into my Node app?

Hey guys I'm currently building a Node app and I want to implement a feature where users can stream embedded YouTube/Vimeo videos with their friends. Is there a suitable module that can help me with this?

Submitted January 21, 2017 at 05:32PM by awkwardio

Quick Intro to Node.JS Microservices: Seneca.JS

http://ift.tt/2iezC3s

Submitted January 21, 2017 at 05:55PM by ivan_jovanovic

How to run Express, Koa and Hapi on HTTP/2 protocol

http://ift.tt/2j84c1w

Submitted January 21, 2017 at 05:18PM by ivan_jovanovic

Top 10 new NPM libraries for this week

http://ift.tt/2iXmEGA

Submitted January 21, 2017 at 04:09PM by self_refactor

ORM for Node - which is better, Bookshelf or Sequelize?

So, I've been working with Nodejs (express framework) for a couple of years now and I've always used Bookshelf. It has its shortcomings but overall it did the job well. However, I've seen an increase popularity with Sequelize. Has anyone used this ORM and how does it fare with Bookshelf? Thanks for your answers in advance!

Submitted January 21, 2017 at 09:48AM by JavascriptFanboy

dotJS 2016 - Vladimir de Turckheim - NoSQL injections in Node.js: The case of MongoDB

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

Submitted January 21, 2017 at 08:24AM by dobkin-1970

Live Node.JS Training Classes by Node.JS Experts

http://ift.tt/2jY5zON

Submitted January 21, 2017 at 06:41AM by katelyn456

Friday 20 January 2017

Trying to make a Discord Sound Bot that plays sound clips, but I keep getting an error

We coded this bot on my friend's computer and the sound effects played perfectly fine then. But now I'm trying to run it on my computer, and while other functions work, the sounds do not play (the bot just joins the voice channel and does nothing), and I get the below error.Basically it seems I'm missing something called FFMPEG. Any idea how to fix this? Thanks!This is the error I get:C:\Users\Noah\Documents\noahbot>node app.js BobBot is Ready C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.js:80 throw new Error( ^Error: FFMPEG was not found on your system, so audio cannot be played. Please make sure FFMPEG is installed and in your PATH. at chooseCommand (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.js:80:9) at new FfmpegConverterEngine (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.js:45:20) at AudioPlayer (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:19:23) at VoiceConnection (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\VoiceConnection.js:58:19) at PendingVoiceConnection.upgrade (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:241:12) at PendingVoiceConnection.pass (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:220:28) at PendingVoiceConnection.checkReady (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:151:12) at PendingVoiceConnection.setTokenAndEndpoint (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:192:10) at ClientVoiceManager.onVoiceServer (C:\Users\Noah\Documents\noahbot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:36:74) at emitOne (events.js:96:13)

Submitted January 21, 2017 at 06:23AM by NormalNormalNormal

A Node.js Perspective on MongoDB 3.4: $facet

http://ift.tt/2k5UbQe

Submitted January 21, 2017 at 12:44AM by code_barbarian

Parsing absolutely anything in JavaScript using Earley algorithm

http://ift.tt/2jJpaVs

Submitted January 21, 2017 at 12:03AM by gajus0

node.jSTL - Electron + Vue.js

We recorded last night's node.jSTL meetup and I thought some here might find it an interesting watch.The video.

Submitted January 20, 2017 at 10:13PM by hlfshell

Trying to make bot with node/discord.js, getting error

So I'm following this guide to make a discord bot but I keep getting an error when I try to do the step at 10:08. I get this error. Here is a screenshot from installing the modules if that's relevant.So basically I'm stuck on this step and have no idea how to progress. Any help would be appreciated.Thanks!EDIT: And yes, I made the file called app.js in the MyBot folder

Submitted January 20, 2017 at 07:17PM by NormalNormalNormal

Update page from data sent from a Post request in Express

"I'm learning Express and I am trying to build something kinda like bit.ly's web page (The url shortener and stuff) Right now I can get the links to be displayed on page and everything but when I refresh the page the link is still there, it doesn't disappear until I restart the server; I can generate new links and it's replaced but if I refresh the page it doesn't go away."That was a problem that I had and someone answered me that it was because some variables were set to the global scope and when I changed their values they stayed like that after each refresh. I asked about what could be a fix for this so I can still pass the variables to the templating engine and change the value of these with the information of the post request and the answer was that I could make the postreturn a JSON object with the data instead of doing a redirect. Then do the POST async from the client and display the data.My question is how can I do that last part? The POST async from the client and display the data. This is my code. I could see the error that I was having before but I don't know exactly how can I keep the same behavior with the suggestion that I got.var data; var url; /* GET home page. */ router.get('/', (req, res, next) => { res.render('index', { 'data': data, 'url': url}); }); /* POST HANDLER */ router.post('/link', function(req, res, next) { url = req.body.link; bitly.shorten(url) .then(response => { data = response.data.url; res.redirect("/"); }); }); I was using a form but changed it to a jQuery request:$('#shortLink').on('click', () => { $.ajax({ type: 'POST', url: '/link', data: {link: $('#linkInput').val()}, success: data => { console.log(data); } }); }); And that's it. Hope someone can help me or tell me if I need to explain my issue more in depth. Thanks.

Submitted January 20, 2017 at 08:24PM by Aguxez

Node.js - Beginners Tutorial

http://ift.tt/2jgUZ4s

Submitted January 20, 2017 at 06:57PM by bppereira

Efficient Docker with the new Yarn package manager & native packages like Bcrypt for Node.js apps

http://ift.tt/2jgB3Pk

Submitted January 20, 2017 at 04:49PM by jineshshah36

Trying to code a Discord Bot, getting stuck early on?

I've been following this guide, but at 2:48 I'm stuck because I don't see "Console Application" as an option on the list in my Blend for Visual Studios (just downloaded the program for the frist time so I have no idea how to use it).How can I get "Console Application" as an option so I can move on to the next step?Thanks.

Submitted January 20, 2017 at 04:06PM by NormalNormalNormal

Awesome Node.js Weekly - Issue 36

http://ift.tt/2iJllAb

Submitted January 20, 2017 at 01:02PM by stanislavb

OpenID code grant using IDP (with Auth0)

Hey /r/node,I'm currently learning about OAuth and OpenID and I had one question regarding the id_token (JWT containing the user claims).I'm using Auth0 with an external identity provider (IDP) using SAML.I have my backend server with a /login route. This redirects the user to the auth0 /authorize endpoint, which in turn redirects to the IDP's login page.User logs in and is redirected back to my backend route; /login/check with the code in the querystring. Pretty straight forward so far. The backend then calls the auth0 /token endpoint to retrieve the access and id tokens.This is where my question arises... Should I return the id_token back to the user at this point or should it be kept on the backend? I've spotted some comments here and there saying the token is safer stored on the backend, but this doesn't make sense to me.My backend at this point has access to the secret (trusted) so it has no real need for the token and instead needs to verify the users authentication. If I return the id_token to the user then happy days, they have a token that I can verify and all is well.This id_token can't be used to access the IDP directly, only really allows access to my own application.What would be the alternative to returning the id_token here? And is my implementation above odd or pretty standard when it comes to using IDPs in Auth0?

Submitted January 20, 2017 at 12:23PM by mitchjmiller

Node.js Weekly Update - 20 Jan, 2017

http://ift.tt/2iRPt7i

Submitted January 20, 2017 at 10:20AM by hfeeri

Eloquent to start?

Hello!I am coming from Python world, where I have been using Flask and Django for quite some time now but I on planning on moving to Node.js.I don't have much experience in JavaScript - almost none, so I am turning to you for help. First I need to get some JavaScript knowledge before moving to Node. Tell me, is Eloquent JavaScript good book to start? Heard a lot good about it. Or is there any better? I prefer books. And after I learn some JavaScritp - what books are recommended for Node.js?Thank

Submitted January 20, 2017 at 10:41AM by xfrozenspiritx

How to generate beautiful pdfs for website?

Hello,I am building a course website. At the end, I would like to generate a beautiful pdf for the user. I am aware of the Markdown-pdf package but I was looking for a little bit of styling.Can anyone suggest how to go on and do it?Thanks

Submitted January 20, 2017 at 07:25AM by geek--god

Thursday 19 January 2017

How to grab data from an array, to create another array of objects in the same order of objects.

I have an array like so: variants: [ { id: 36829111623, product_id: 9708754503, title: 'S / White', price: '19.99', sku: 'example-shirt-m-1', position: 1, grams: 200, inventory_policy: 'deny', compare_at_price: '24.99', fulfillment_service: 'manual', inventory_management: 'shopify', option1: 'S', option2: 'White', option3: null, created_at: '2017-01-18T05:41:15-05:00', updated_at: '2017-01-18T20:30:15-05:00', taxable: true, barcode: '', image_id: null, inventory_quantity: 1, weight: 0.44, weight_unit: 'lb', old_inventory_quantity: 1, requires_shipping: true }, { id: 36834204935, product_id: 9708754503, title: 'S / Blue', price: '19.99', sku: 'example-shirt-m-2', position: 2, grams: 200, inventory_policy: 'deny', compare_at_price: '24.99', fulfillment_service: 'manual', inventory_management: 'shopify', option1: 'S', option2: 'Blue', option3: null, created_at: '2017-01-18T06:58:08-05:00', updated_at: '2017-01-18T06:58:08-05:00', taxable: true, barcode: '', image_id: null, inventory_quantity: 1, weight: 0.44, weight_unit: 'lb', old_inventory_quantity: 1, requires_shipping: true }] Theres a lot of data that I dont need to save, ideally i need to have an array in the same order of the objects above but with this data: [{ price:, title:, id: }, { price:, title:, id: }]

Submitted January 20, 2017 at 02:55AM by farhansyed7911

Question about Node, Express, and dynamic routing.

I have started to get the hang of Node and have started playing with express to display some very very simple pages. Right now I have a chat bot for twitch. The users are all pulled from a database and stored in memory. I would like to use express to display some very basic information about a user by going to /username. I can make it work by hardcoding app.get statements likeapp.get('/azazael13', function (req,res) { res.send (stuff for that user); }); I would like to be able to do this automatically by going through my list of users, and having express generate the pages on the fly. Is this possible? If not, is there a solution that would work that doesn't require hardcoding?

Submitted January 20, 2017 at 01:11AM by azazael13

How can I avoid creating resources in my server?

To provide some background information, I have a simple app that takes form input from the browser, creates a PDF from it using the pdflatex command, and then sends the PDF back to the browser to be downloaded.Here is my file structure:. ├── app.js ├── doc.cls └── doc.tex And here is my relevant app.js code:const { spawn } = require('child_process') spawn('pdflatex', ['doc.tex']) When this code runs, a doc.pdf and doc.log file gets created. What I'm trying to do is avoid actually creating any files at all, and just somehow stream the doc.pdf straight to the browser as a response.Is this possible or do I have to do something like send the doc.pdf as a response and then delete the doc.pdf and doc.log file immediately afterwards manually?Any help would be appreciated.

Submitted January 19, 2017 at 09:44PM by inhwre

Quick question about Client and Server project structure

I'm currently developing an application backend using Node, Express and MongoDB. For the front-end I'd like to use React/Redux to accomplish my project goals. However, I'm confused about what the exact structure of such a project should be, and how to handle deployment.Should I have one client folder and one server folder in an overarching project folder? If so, how do I handle that in deployment and tell Heroku or Docker to display my static files? What are your project structures or "best practices" for this.

Submitted January 19, 2017 at 07:40PM by MiltownVet

Is NPM for getting js libraries that work with nodejs?

What is the gist of NPM? I am trying to move away from WordPress as a platform for basic websites. My friend said, "are there plugins?", I said "well there is NPM, where there are tons of code/projects/libs that are written in JS and they are meant to work with NodeJS. The only thing is that it takes programming knowledge to implement into your projects, its not seamless like installing a plugin on WordPress". Was what I said correct?

Submitted January 19, 2017 at 07:44PM by mineralwatersoda

Preferred testing framework?

I am starting a greenfield project and am currently researching various testing frameworks. Right now the big contenders look to be:Mocha + Chai + SinonJestAva + SinonWhat is your preferred node testing framework and why?

Submitted January 19, 2017 at 04:13PM by fokinsean

[Javascript] inheritance behind the scene __proto__, [[prototype]] and prototype

http://ift.tt/2iFIiE5

Submitted January 19, 2017 at 04:34PM by bananajsjs

What is the correct way to upload and retrieve a PDF file?

I'm still a learner and I'm currently using express/mongoose/ejs for one of my websites and for one of my forms I'm trying to add an upload option so that the user can upload a PDF file. The PDF files are less than 2MB.Am I supposed to upload the PDF to my mongoDB or file system? Could someone point me in the right direction on how to go about this and where to get started properly?I have been looking at a few examples and blogs and I'm just overwhelmed by all the choices there are e.g. formidable, GridFS etc...

Submitted January 19, 2017 at 03:17PM by SparkDe

Is there a way to add client side Bootstrap without manually downloading files and putting them on the server?

Hey, I am developing an Electron application and I would like to use Bootstrap on the client side.At the moment I downloaded the files from the Bootstrap website and I get them with a script tag. Is there a way to do this with npm?

Submitted January 19, 2017 at 01:04PM by NanoVash

I don't understand what installing Bootstrap through npm means

Basically, I'm working on an Electron project and I want to include Bootstrap in my html page.I've seen tutorials about using npm install bootstrap@3 and then adding var bootstrap = require('bootstrap') but what does this actually do? What does requiring this variable on the server let me change? And from here, how can I add Bootstrap to the client side since I installed it on the server?

Submitted January 19, 2017 at 12:35PM by NanoVash

What are the best tools for setting up complete NodeJs testing infrastructure.

A Testing Framework (Mocha, Vows, Intern) An Assertion Library (Chai, Assert) Stubs (Sinon) Module Control (Mockery, Rewire)I found these online, any better alternative in each tool/library.

Submitted January 19, 2017 at 10:39AM by ratancs

Wednesday 18 January 2017

I like travis-ci but they are too expensive for personal projects...what alternatives are there?

I have some private repos and need a CI service to run automated tests/builds etc.I hate jenkins. What else is there?Willing to pay $5-10/mo for unlimited private repos

Submitted January 19, 2017 at 06:40AM by agentf90

Node Equivalents of Ansible, Salt, Chef, Puppet, etc.?

I have an all NodeJS team and need to start planning an upcoming DevOps project (imagine a customer signs up and we automatically deploy them a wordpress with it's own database and configurations, except instead of wordpress it's our other product and the deployment requirements are slightly more complicated). I don't have a full idea of what advantages those tools (Ansible, Salt, Chef, Puppet) will give me over a small SQL+express app with npm ssh2 and bash scripts. I consider myself pretty fluent in linux/bash, so I'm actually a little worried about these kinds of tools abstracting too much away unnecessarily. If it matters, we're going to be first using AWS and might try to explore some light compatibility with GCE and other providers later. Autoscaling and high availability are not high priorities for this.Any package suggestions, thoughts on direction I go into or look at, etc.. would be much appreciated.

Submitted January 19, 2017 at 02:10AM by LeBuddha

Best place to learn deployment?

I am a self taught, and I taught myself node express angular react mongo and all those jimmy jams. But, I still am not sure about deployment and environment and don't really know where to learn that stuff. I was wondering if anyone knew the best place to learn that kinda stuff

Submitted January 19, 2017 at 01:41AM by Gemisheresy

Node Inspect Broke My Workflow!

http://ift.tt/2ibEhX3

Submitted January 19, 2017 at 12:18AM by alias_willsmith

Web crawler in node/express. How to make it better/faster?

Hi there! I'm trying to learn some node/express. I wrote a simple web crawler based on this tutorial. I believe it works but I guess it could be done much better. Would anybody would be so kind and take a look at my code to show me the weekest parts of it? Crawler with url provided should gather all internal links and follow them to do the same. So basically the aim of this crawler is to gather all internal links of a given domain.Here is a link to a part of my controller responsible for crawling.So: what could be done better? How to made that script more performant?Thanks in advance!

Submitted January 18, 2017 at 10:53PM by filipoi

BlackOrphan is a tool built with Bash/nodeJs mainly for gaining a remote shell access to a Linux Box

http://ift.tt/2iD1aUe

Submitted January 18, 2017 at 10:55PM by 73mp74710n

How to debug slow apps?

Say that an app eventually starts slowing down, in which a restart temporarily remedies it. What would be the best tools/way to find whats causing it?

Submitted January 18, 2017 at 08:35PM by loftyal

Managing Multiple Node Versions

http://ift.tt/2iRPag5

Submitted January 18, 2017 at 05:54PM by ramsunvtech

Looking for useful tools to use in new projects

Last week I decided to create a simple tool that generates a boilerplate for my future command line apps based on the specific needs of a project. I have experience with babel, flow, eslint, ... which are all added to the tool at the moment. You can find the boilerplate here: http://ift.tt/2k0Hx4U there any other awesome tools/libraries that I might be missing which might speed up the development process of my future tools? What are your favourite/must-have utilities? I have not much 'real world' experience (ie in a company) with NodeJS, just learned most of it on my own.

Submitted January 18, 2017 at 06:37PM by artificialcode

Learn Node.js by building 5 real world apps.

http://ift.tt/2jL55eF

Submitted January 18, 2017 at 05:18PM by jamesvad

Command-line debugging cheatsheet

http://ift.tt/2jx91m5

Submitted January 18, 2017 at 03:52PM by thomas_stringer

Random destination generator with map and facts from the CIA

http://ift.tt/2imNbAi

Submitted January 18, 2017 at 01:31PM by CharlesTati

ELI5 - can you explain me how to use my existing backend nunjucks templates on browser side?

So basically i'm using nunjucks templating for a while in my node.js backend but i guess i need some help now.I've a basic comment.html nunjucks template which i'm already using in my backend but i also need be able to use it within browser side.So when user sends a comment, after my jquery ajax call to my api, i need to render the very same template from browser side.Will be great if anyone can help me.

Submitted January 18, 2017 at 02:15PM by raistlinthewiz

Improving your Node.js Application Performance

http://ift.tt/2j4IkBx

Submitted January 18, 2017 at 02:33PM by linkpaper

How Well Do You Know Node.js? - Answers (Part 2)

http://ift.tt/2jZTiZj

Submitted January 18, 2017 at 02:55PM by asafdav2

What is the correct way of sorting a HTML table containing data from MongoDB?

I'm trying to figure out a way of sorting my table in ascending order. At the moment it is just sorting the table by the order the data was inserted into my database.like so current table imageShould I be sorting the data by date in the database or using javascript in the front end to sort the table?

Submitted January 18, 2017 at 03:25PM by SparkDe

How can I correctly install Node on Ubuntu 14.04 (allowing for global installs without sudo)?

I installed Node on Ubuntu 14.04 by running the commands shown here:curl -sL http://ift.tt/26PL3TG | sudo -E bash - sudo apt-get install -y nodejs After that, I ran npm config get prefix and the output was /usr. I tried install something globally (using npm install -g), but got an EACCES error. I went to the "Fixing npm permissions" page and saw that option 1 (Change the permission to npm's default directory) was not an option if npm config get prefix outputs just /usr. So now I have a few questions:Why does the official method of installing Node not allow global installs without sudo?Why does the official method of installing Node install it into /usr and not /usr/local?What is the best way to deal with this? Is it following the instructions for option 2 (Change npm's default directory to another directory) to set the prefix to /usr/local? That doesn't seem right because then wouldn't every user on the system who wants to use Node have to update their PATH or set the NPM_CONFIG_PREFIX environment variable?

Submitted January 18, 2017 at 03:28PM by nrogers64

Why did Product Hunt move from Ruby on Rails to Express/Node ?

Just noticed that on my Wappalyzer extension. Why would they do that ?

Submitted January 18, 2017 at 11:24AM by syscom13

For the Love of Code

http://ift.tt/2jy9wvO

Submitted January 18, 2017 at 11:37AM by avi00

The Complete Node.js Developer Course 2.0

http://ift.tt/2jy8no3

Submitted January 18, 2017 at 10:25AM by nandusingh

Using “Server-less” Architecture to Massively Parallelize DNA Sequence Alignment via StdLib and Node.js

http://ift.tt/2iHzwRr

Submitted January 18, 2017 at 10:30AM by keithwhor

What’s It Like Being on the Node.js Foundation Board of Directors?

http://ift.tt/2jcscl4

Submitted January 18, 2017 at 10:03AM by fagnerbrack

How to find Node.js Performance Optimization Killers

http://ift.tt/2jJwZrs

Submitted January 18, 2017 at 10:17AM by ecares

Using Visual Studio to remote debug a node.js application on a BeagleBone Black

http://ift.tt/2jmJqK7

Submitted January 18, 2017 at 09:20AM by joey_php

Tuesday 17 January 2017

Suggestions on how to build a ChatBot using Node.js.

Hello, developers! I am relatively new to the Node.js environment. Finished a couple of tutorials on streams and callbacks and built a basic chat application using socket.io. Now, I would like to build a Chatbot using Node.js (preferably for Messenger). Could I get some pointers on where to begin and what libraries(like Recast.AI ?) to use?

Submitted January 18, 2017 at 03:17AM by hvb97

Best way to loop through arrays?

I need to loop through possibly over 100+ objects within an array and save the appropriate data to my database to be saved.What is the best way to achieve this while keeping it efficient?

Submitted January 17, 2017 at 11:29PM by farhansyed7911

Structure now supports validation of raw data

http://ift.tt/2jZYssi

Submitted January 17, 2017 at 11:25PM by TalyssonOC

Just a simple package that check whether a value is an class

http://ift.tt/2jlkq5Z

Submitted January 17, 2017 at 09:49PM by nof1000

Multiple event listeners?

I'm trying to work around a problem to do with rest streaming between the Nest API and a service (SmartThings) that does not support streaming.To get around this, I have built a service on Sails which takes a post request from SmartThings containing the Nest Token, and then triggers an EventSource event listener that sends the data back to SmartThings.I can easily do this through the browser, however this requires the user to keep the window open which isn't suitable since this needs to be running 24/7.The only way I can think to do this is to create Node service whereby users can initiate a call to my site, that starts the process - almost a multi version of this: http://ift.tt/2jW6n5E problem with this is that I cant figure out a way to control this. When the user starts the stream, there is no way for them to manage it or stop it so the listener will run indefinitely.Does anyone know how I can control this? The only thing I can think of is to create a process for every listener, but there would be in excess of 5000 processes...Any suggestions?

Submitted January 17, 2017 at 07:27PM by Evostance

How easy is it for a self-taught dev to get a node job?

I'm not a CS major, but I have been learning React and JS in preparation for my job search in the summer. I have been creating a portfolio in my spare time showcasing front-end stuff. At the same time, I am wondering if I should learn back-end also. How hard it is to get a node.js job without prior experience and a CS degree? Is there any way to create a portfolio of sorts with node.js? Should I just continue focusing on React and Front-end?

Submitted January 17, 2017 at 06:19PM by T-Dot1992

Regular Expression Denial of Service and Catastrophic Backtracking in Node

http://ift.tt/2k1sbkB

Submitted January 17, 2017 at 05:43PM by tkadlec

Node.js Async Best Practices & Avoiding Callback Hell

http://ift.tt/2jV2nm4

Submitted January 17, 2017 at 03:09PM by hfeeri

deepdancer: dependency injection for node

http://ift.tt/2jsC8ah

Submitted January 17, 2017 at 02:46PM by frantzmiccoli

A sketch-note guide to node.js streams

http://ift.tt/2j2cdWk

Submitted January 17, 2017 at 11:30AM by fagnerbrack

Visual Studio Code Jumpstart for Node.js Developers

http://ift.tt/1Vamag3

Submitted January 17, 2017 at 08:36AM by avi00

A Node.js IDE for Visual Studio Devs -- Visual Studio Magazine

http://ift.tt/2jrp4le

Submitted January 17, 2017 at 09:49AM by php03

Node.js for beginners, 10 developed projects, 100% practical

http://ift.tt/2j40kMt

Submitted January 17, 2017 at 09:55AM by Helen791

kuee: command line utility for kue

http://ift.tt/2jrotQC

Submitted January 17, 2017 at 10:01AM by wonderfuly

Any updated article on same topic

I was looking for Nodejs testing tools, this article is good http://ift.tt/2iwzws6 old, any updated article on the same topic.

Submitted January 17, 2017 at 07:43AM by ratancs

Monday 16 January 2017

Where can I find native data structure implementations available as Node.js Addons?

Maybe I'm not searching correctly, I'm looking for things like sets and maps in particular, written in C++ and available as Node.js addons.They will be read/written to quite quickly, so that's why I'm looking for a native solution.Thanks

Submitted January 17, 2017 at 01:55AM by Matthew_KY

Running an action once a day

Is this the appropriate/best way to achieve this?setInterval(function(){ if(currentTime === actionTime){ doAction(); } }, 1000); Basically, the app is running this interval and if the current time is set to the action time (let's say, 12:00pm every day), then it runs the action.

Submitted January 17, 2017 at 12:50AM by Garmichael

Express middleware that exposes client modernizr information to the server.

http://ift.tt/2jtaZ6r

Submitted January 16, 2017 at 11:34PM by rlindskog

Need help with webpack and sqlite3

I am trying to figure out how to use sqlite3 for a vuejs project, but webpack does not like C bindings, so webpack fails.I know there is a way in the webpack config to ignore sqlite3 as a module, but i cannot seem to get it working and, to be honest, documentation is incredibly weak. no example so far has made too much sense to me, but that may be because I am new to the whole webpack ecosystem.I am using vue-loader as a quick boilerplate. Any advice would be much appreciated!

Submitted January 16, 2017 at 10:31PM by distortednet

OSX: How can I move node or specify a directory on reinstall (Homebrew)

Installed in usr/local/bin, which I can't easily access in Finder. I'd rather not mess around in usr anyway. Can I run Node in any folder? How can I specify where? And is there a way to just pick up my current install and move it?

Submitted January 16, 2017 at 08:01PM by manamachine

Detect if User is Away

I have a node application that can detect if a user is online and can detect when they're offline. But how can I detect if they are idle or away?

Submitted January 16, 2017 at 04:45PM by soaringradio

NodeJS C++ client node-firebird-libfbclient 0.0.15 updated with Firebird events fixes

http://ift.tt/2jX6UZg

Submitted January 16, 2017 at 03:40PM by mariuz

Is app.put and app.delete pointless in express when using forms

Just the other day, I was trying to figure out how to update documents and remove documents with express. I thought I was supposed to put an input tag after the form like this:
But it didn't do anything when I submitted the updated data. I soon started to figure out that the only way to update information is to use the app.post method, and then run a mongoose.update function to actually update a document. I figured out that is also the way to delete documents in mongodb as well. So I want to know if app.put and app.delete is pointless when really working information with forms or is there a way to use them with forms and I'm just doing it wrong

Submitted January 16, 2017 at 03:09PM by Design_Newbie

Socket.io customer support application architecture design. Looking for opinions

Hello, I am building a customer support chat application connecting end consumers to agents with a backend panel. Each consumer is connected to an agent and an agent can accept multiple chats. I am using node.js and socket.io to build this app. Currently I see the architecture this way. Server will have one socket connection with end consumer and one socket connection with an agent. I'm thinking to have agent sockets on a different namespace(for e.g. '/admin'). Whenever a consumer socket connection is created, it is mapped to an agent socket connection and I will maintain this mapping in a persistent data store. Eventually, idea is to replace agents with bots. I would like to hear opinions on this design, any problems I will face, whether this can be scalable or not. Anything you think I should be wary about.

Submitted January 16, 2017 at 01:22PM by amithrm

TypedArray or DataView: Understanding byte order

http://ift.tt/2ibunl4

Submitted January 16, 2017 at 12:49PM by fagnerbrack

Build your first Node.js microservice

http://ift.tt/2ihoKpj

Submitted January 16, 2017 at 11:54AM by r-wabbit

Microsoft brings Node.js debugging to Visual Studio

http://ift.tt/1CRxG7v

Submitted January 16, 2017 at 11:24AM by php03

Node.js Development with Visual Studio Code

http://ift.tt/21OtoZS

Submitted January 16, 2017 at 10:31AM by avi00

QuorraJS v1 released.

http://ift.tt/2iZeAGs

Submitted January 16, 2017 at 07:50AM by harishanchu

Sunday 15 January 2017

How to set up functional testing for a web app from scratch in 5 minutes

http://ift.tt/2jpBb21

Submitted January 16, 2017 at 06:51AM by henry_tula

What's the gold standard framework for developing a REST service?

I'm writing the backend for an iOS app and need to develop a REST service. Pretty much decided to use node rather than Java and am wondering if Express is still the go-to framework for whipping up an API? I have made web apps using Express 3.0 but lately have been writing libraries for npm so I've been out of this domain for a little while. Any suggestions would be great. I remember Sails being highly recommended and Meteor being newer but also supposedly good.Thanks!

Submitted January 16, 2017 at 12:56AM by anacondaballpit

Did a quick write up on how we implemented a networked differential steering system for our Node.js based rover. Thought I'd share.

http://ift.tt/2jzacP7

Submitted January 15, 2017 at 11:21PM by MrAckerman

How to build and deploy static websites using Metalsmith

http://ift.tt/2iroX9F

Submitted January 15, 2017 at 07:50PM by hobonumber1

How to HTML > PDF with Node.js?

I have a HTML file with styles, is there solution for streaming to client a PDF file that respoects the formatting of my HTML page?I tried using phantom.js and I get a PDF but all unformated.What do you guys use?

Submitted January 15, 2017 at 03:22PM by rickard78

Building Node.js Applications in Visual Studio (MEAN stack)

http://ift.tt/1IbEVdk

Submitted January 15, 2017 at 10:42AM by joey_php

'Hello World' with Node.js and Visual Studio Code

http://jdav.is/2015/08/05/hello-world-with-node-js-and-visual-studio-code/

Submitted January 15, 2017 at 09:31AM by php03

How to Host a Node.js App on Digital Ocean

http://ift.tt/2j5r0Ah

Submitted January 15, 2017 at 09:44AM by katerina-ser60

Real-time Application quick start with socket.io/Firebase

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

Submitted January 15, 2017 at 08:30AM by DavidGuanDev

Saturday 14 January 2017

Advice on setting up Express.js database? I suck

Hi all. I'm getting into Javascript more and want to build a website. I'm building out the backend first, starting with the database. Here's my situation:-I'm going with Express.js for the project.-I'll have a DB that will start off on local files but can transfer to a server. I've tried PostgreSQL so far.-The traffic and complexity of the website will not be high.-I'm open to anything that will fit this criteria-I have my database schema all marked up on paper, but can't find out how people express this in their code.-I'm currently on Ubuntu, and don't have $$ to buy software.The issue is that for the life of me I cannot figure out how to properly get SQL software up and running, or anything for that matter. I can't even find code that expresses how to set up a relationship between 2 tables.I've been trying with software that contains GUI's for relational database models, but at this point I'd be happy with anything. I just suck at installing stuff and I've spent 7 hours trying to implement PostgreSQL with no results.If you were me, and you had my requirements and impediments, where would you start? What software/tools would you use? What articles would you read to give you the proper information? Keep in mind that I've been reading lots of documents for what I'm trying to download, but that's so much that I just have trouble understanding with downloads.

Submitted January 15, 2017 at 03:53AM by rawrSilverGold

help using nvm and node on debian

So I've installed the nodejs package from the debian repos, and aliased the command with node. When I run node --version I get 4.7.2, the version listed in the debian repos.Then I installed the node version manager nvm and ran nvm install node && nvm use node and it says node version 7.4.0 was installed but when I run node --version Im still using v4.7.2.The reason this is an issue is because I am using the node module sequelize and sqlite3 but I'm getting the error below and many of the resolutions seem to deal with upgrading to node v5+ Error: Please install sqlite3 package manually

Submitted January 14, 2017 at 11:02PM by masterurbiz

Ghost vs Wordpress

Im currently learning web development. I only know the basics of HTML/CSS but will be moving onto JavaScript and Node eventually.I also want to create a blog. As I wont be learning PHP im thinking of staying away from Wordpress. There is a blogging platform called Ghost that relys on node.js.Considering my learning ambitions. Is this a smart move? or are there better options?

Submitted January 14, 2017 at 09:01PM by FutureHope2

Ingredients of Effective Functional JavaScript: Closures, Partial Application and Currying

http://ift.tt/2ixbOKu

Submitted January 14, 2017 at 08:23PM by hugo__df

Find people to learn nodejs with you

https://colearn.xyz

Submitted January 14, 2017 at 08:39PM by colearn

How Well Do You Know Node.js? - Answers (Part 1)

http://ift.tt/2jbGbFk

Submitted January 14, 2017 at 06:00PM by asafdav2

Create a NodeJS package with all the c00l3st things in NodeJS (Babel, Jest, Flow, Documentation)

http://ift.tt/2jFW71w

Submitted January 14, 2017 at 05:35PM by diegohaz

Proper way to get out of "Callback Hell" and update a record that has columns that rely on other collections/tables.

I am trying to update a user record based on a password and two dropdowns but only if they are changed. So far I can't get out of Callback Hell and this is the closest thing I have to working:router.post('/', function (req, res, next) { if (req.session.user_id) { mongoose.model('User').findById(req.session.user_id, function (err, user) { if (err) throw err; if (user) { mongoose.model('Table1').findOne({ name: req.body.t1 }, function (err, rec1) { if (err) throw err; mongoose.model('Table2').findOne({ name: req.body.t2 }, function (err, rec2) { if (err) throw err; if (req.body.password) { user.password = req.body.password; } if (user.col1 !== rec1._id) { user.col1 = rec1._id; } if (user.col2 !== rec2._id) { user.col2 = rec2._id; } user.save(function(err) { res.redirect('/settings'); // is there a scope issue here? }); }); }); } }); } }); I'm not sure how to fix this... Any and all suggestions are welcome! Thanks for the advice in advance!

Submitted January 14, 2017 at 04:17PM by DTheDeveloper

Node.js's npm Is Now The Largest Package Registry in the World

http://ift.tt/2jMgtKD

Submitted January 14, 2017 at 03:40PM by speckz

Webpack: Sass / Scss compiling to separate file

http://ift.tt/2jiUTfw

Submitted January 14, 2017 at 09:50AM by jonathanmh

Friday 13 January 2017

A simple and beautiful Wiki for teams built with Node

http://ift.tt/2hYLnyV

Submitted January 14, 2017 at 12:14AM by nshntarora

How well do you know Node.js?

http://ift.tt/2iptxjQ

Submitted January 14, 2017 at 12:07AM by samerbuna

How to get multipage JSON results from Google and Zendesk APIs

http://ift.tt/2itfIEl

Submitted January 13, 2017 at 07:59PM by tanyagupta

command: nvm giving 'command not found' but node-- version works

I am trying to update the configuration_tests for deploy through codeship, and I cannot find my version of node version manager. I am thinking I could have uninstalled by 'recommitting to an old master'. I cannot get nvm to show me the version. There is a node_modules folder in my main user's root directory, along with an npm-debug.log. Any suggestions will be very helpful.

Submitted January 13, 2017 at 07:08PM by thewannabedeveloper

backpack: A minimalistic build system for any Node.js project.

http://ift.tt/2jA7GHm

Submitted January 13, 2017 at 03:59PM by juanpabloaj

'Failed' attempts when trying to push changes using git through codeship [gulp static] full logs included

Should a Node noob learn Express first then Adonis.js or is it OK to just dive in?

Ok so I am pretty much writing ES2015 code every day. I really want to dive into Nodejs. I am really fond of Vue.js and have been using it constantly the past year. I recently found Adonis.js and its really like Laravel, which I also use allot. Should one start with Express or is Adonis just as good?

Submitted January 13, 2017 at 01:55PM by d_hristov

How to install NodeJS 6.x Long-Term Support (LTS) on Ubuntu/Debian and CentOS

http://ift.tt/2jLDHk0

Submitted January 13, 2017 at 11:01AM by RubrickOfRuin

Node.js Weekly Update - 13 Jan, 2017

http://ift.tt/2jeyyjt

Submitted January 13, 2017 at 09:10AM by hfeeri

Node module boilerplate with Babel, Jest, Flow, Documentation and more.

http://ift.tt/2iqN8n1

Submitted January 13, 2017 at 04:55AM by diegohaz

Thursday 12 January 2017

Gave a lightning talk on Node on IBM Mainframe. Hard Hat required.

https://www.youtube.com/watch?v=5OHeJca_ByA&feature=youtu.be

Submitted January 13, 2017 at 02:50AM by spmcbride1201

Is that any node.js chat room on Discord?

I was trying to build a React + node + mongodb webapp, and kinda finished React part with a lot of help from React Discord chat room. Do we have similar ones for node.js?

Submitted January 13, 2017 at 01:48AM by FateRiddle

How to run http-server in background from startup (ubuntu)?

I'm new to Linux. I'm trying to run http-server (http://ift.tt/1AsRga5) from startup and so it runs in the background. I've read that maybe I should use systemd but I can't figure out how. I'd thought this would be something basic that there would be tutorials about but there isn't and I can't figure it out. Any help?

Submitted January 13, 2017 at 01:02AM by puterhelper

A cry for help with /r/changemyview's DeltaBot code.

http://ift.tt/2jJ8AW7

Submitted January 12, 2017 at 08:58PM by Snorrrlax

Express + React SPA + JWT + MongoDB. How?

Hello folks!I have been playing with Node for some months now and have understanding of RESTful design among other things. In order to improve my skills I am wondering to build a webapp (SPA) written in React that will have a user login system (using Google OAuth) however I have some questions. I was thinking to write an API in node obviously with CORS enabled and will I need JWT for authentication? I am also confused about managing the routes for both Express and React. Now I am not entirely sure if this is how people do it (or what the industry standard is) so I am looking for some guidance as to what should be my course of action. Please help me.Thank you in advance!

Submitted January 12, 2017 at 09:22PM by nodejs_guy79872546

T38T: Simple 3D multiplayer online, nodejs + websockets + threejs + tile38

http://ift.tt/2ipzsq3

Submitted January 12, 2017 at 07:50PM by juanpabloaj

Migrating from Expressjs 4 to 5

http://ift.tt/2jASvxR

Submitted January 12, 2017 at 06:48PM by simplicius_

ModClean 2.0 - Clean your node_modules folder, now with more features and plugins!

http://ift.tt/2ikKhJe

Submitted January 12, 2017 at 06:21PM by bigross1324

Music Library

Greetings Noders!Well, lets talk fast. I am looking for some Node.JS music library that can play music or output it to Node Speaker. (var Speaker = require('speaker'); ...new Speaker();). But the problem with all the libraries is that i was not able to seek through the stream/music/buffer or whatever. What i need are features like this (Play, Stop, Seek (go forward or backward in music), and bool value like isPlaying, also currentTime, totalTime) If anyone know any library that can do this, or have a code with any other library you would save me!I wont stream music to browser where i would play it, the nodejs itself will be the player.

Submitted January 12, 2017 at 05:37PM by bindik

Getting error and 'failed' when trying to deploy through codeship. More info in description.

How to prevent NoSQL injections in MongoDB in a Node.js app

http://ift.tt/2j4I6va

Submitted January 12, 2017 at 03:58PM by ecares

trying to create a palindrome checker

Here's my code:var fs = require('fs'); var check = require("./palin")var words; var revWords;function checkFile(callback){ fs.readFile("eowl.txt", function(err, data){ if(err){ return console.error(err); } words = data.toString(); callback(); }) }function palindrome(){ revWords = words.split("").reverse().join("") if(revWords === words){ console.log(revWords); } }checkFile(palindrome);any hints would be greatly appreciated!

Submitted January 12, 2017 at 02:24PM by Chigurhshairdresser

API documentation with hapi.js and swagger-ui

http://ift.tt/2j47QHY

Submitted January 12, 2017 at 12:33PM by mzupzup

Create your own youtube downloader app in nodejs

http://ift.tt/2jHnDQk

Submitted January 12, 2017 at 10:56AM by mkvmovies

Node.JS Top 10 of the Year

http://ift.tt/2iKpEH6

Submitted January 12, 2017 at 11:56AM by Rajnishro

OpenCV tutorial: Computer vision with Node.js

http://ift.tt/2j3rPXj

Submitted January 12, 2017 at 08:56AM by hfeeri

Handling EU VAT for Stripe and Braintree using Node.js

http://ift.tt/2iJneIZ

Submitted January 12, 2017 at 07:21AM by zomgitsrinzler

Network Visualization Semester Project

Hi,this is a semester Project I have been working on since the beginning of last September.It's a node application supposed to run on a Raspberry Pi. It collects SNMP data from Switches/Routers, calculates 3 Values and sends them to some Huzzah Feathers running Arduino code.It mainly calculates the relation between current values and the max values in a given time frame.The relations then change the color, block-length and speed of lit LED-Stripes controlled by the Huzzahs.http://ift.tt/2jaaYVe

Submitted January 12, 2017 at 07:47AM by Felecorat

Wednesday 11 January 2017

battlefield-stats: A node api for collection and analysis of battlefield 1 and battlefield 4 statistics.

http://ift.tt/2jFWNYK

Submitted January 12, 2017 at 04:22AM by tonechild

Can Someone Put This into Idiot Speak for Me?

http://ift.tt/2jxfFoA

Submitted January 12, 2017 at 01:16AM by NightTerror6

Architecture for barebones app that listens for both Web & plain text Sockets and emits SocketIO message

Need some feedback on best architecture for a barebones NodeJS app.These are the requirements -It should be configurable to listen on a specific port -It should accommodate listening for both Web and plain vanilla TCPIP sockets -It should emit or broadcast a message when it receives the Web or plain Text Socket message to a single client using Socket_IO(no choice here)Ok, simple enough for any NodeJS experts. What packages do I need in addition to Socket-IO? Do I need express? General outline? (I'm not asking for final working code, just an outline)

Submitted January 11, 2017 at 09:37PM by eco_bach

I'm confused about how to use promises to query a postgres database. Looking for advice!

Hey guys,for a new little project, I thought I'd use promises for my database-related stuff, as it seems to become the new standard - I have never used promises before though! I use PostgreSQL and pg-promise. My basic understanding is, that instead of having subsequent queries in nested callbacks, the queries will be chained one after the other. But I don't understand fully how that works.I have the following code in a /register route of a server:db.one("SELECT EXISTS(SELECT 1 FROM users WHERE name=$1) AS 'exists'", [name]) .then(function(data) { if(data.exists) { res.json({ "success": false, "flag": "name_taken" }); } else { //TODO: insert new user } }).catch(function(error) { next(error); }); The first query checks whether the user name is available, and now I have to integrate a second query, that insert the new user. I am confused, about how that should be done. Shoud I:chain a second .then() and do the query inside of thator: execute the query inside the first .then(), and return the resulting data, subsequently handling it in a second .then()Or ar both of these wrong?Any advice appreciated ;)

Submitted January 11, 2017 at 04:49PM by DJLaMeche

how do you debug commandline tools in node + visual studio code?

im not building a react, or angular app. im not runnung a server. how do i run a debugger or set breakpoints in visual studio code? THANKS!

Submitted January 11, 2017 at 03:41PM by whatsmyline

Web App Project Collaboration

A team of about 6-7 people are forming to create a cool project. This will not be a paid position, but if this app makes money we will all split it equally. Mainly, this is for people with a skill that want to work on a project and put it in their portfolio. What do I need? 1 or 2 React and NodeJs developers 1 graphic designer 1 backend developer 1 front end developer Apply here - http://ift.tt/2jvrUly

Submitted January 11, 2017 at 03:19PM by NurdBurn

Capitano: A powerful, non-opinionated command line parser for serious Node applications

http://ift.tt/2iFvBoL

Submitted January 11, 2017 at 12:39PM by pimterry

Best node framework after rails

Hello. I have been working with rails a couple years, now I want to try some node js framework, what is the best choice?Thx a lot.

Submitted January 11, 2017 at 12:41PM by Auxq

Who Bears the Burden of Ensuring NPM Module Security? - The New Stack

http://ift.tt/2ixGN6Q

Submitted January 11, 2017 at 12:45PM by hfeeri

Troubles With Example GroupMe Bot Callback Server

http://ift.tt/1CybvDL As in the tutorial here, one uses Node JS and a crowd of other tools to make a basic bot for GroupMe. However, I have made numerous attempts and failed them all. To date, I have: - Followed the instructions completely, to no avail - Manually added the code to a Heroku project with 'git push' (Was successful) then followed the rest of the instructions - Tried to push updates but Git claimed everything was up to date (it wasn't) - Deleted the project and pushed the updates as the original so it would work (still looked like the old code 🤦‍♂️🤔) - And made sure there were no formatting issues with the bot ID I was pasting to X location

Submitted January 11, 2017 at 12:54PM by NightTerror6

Lebab - Turn your ES5 code to valid ES6 with ease

https://lebab.io/

Submitted January 11, 2017 at 11:31AM by opreaadrian

End-to-End Testing for Your Web App With TestCafe

http://ift.tt/2ifgL7y

Submitted January 11, 2017 at 10:49AM by henry_tula

Navigate through projects on GitHub.com efficiently with the OctoLinker browser extension

http://ift.tt/2idwDHO

Submitted January 11, 2017 at 11:09AM by opreaadrian

Using ES6 arrow functions in production-ready apps

http://ift.tt/2juwbpn

Submitted January 11, 2017 at 10:38AM by opreaadrian

How do you guys map out your app's features when starting from scratch?

Generally I just write a Google Doc with a bullet point list of the features, but this never feels 'right'. Whats your best way to visualize a feature so you have a strong idea of what you have to do to bring it to life and how it connects with other features?

Submitted January 11, 2017 at 08:26AM by Sythic_

Redirecting...

http://ift.tt/2iccTZR

Submitted January 11, 2017 at 09:43AM by avi00

Visual Studio Code for Node.js Development

http://ift.tt/2jhEcij

Submitted January 11, 2017 at 07:07AM by php03

Tuesday 10 January 2017

Best way to integrate a simple windows c++ application into my node app?

Hey guys!I have extensive node and javascript experience but something I've never touched was writing c++ modules. I made this spotify application that listens for a hotkey and saves your current song, and I wrote the listening part in java but it... doesn't really work. Mostly because I do some messed up stuff with ChildProcess to make everything run in the background ( as opposed to having a console window open ). And when I do press the hotkey, a console window pops up for a split second and minimizes full screen applications. Which sucks.So I need to make the listening to a global hotkey in c++ and it would be fantastic if could integrate that into my node.js application directly instead of calling exec. Also, maybe someone knows a better way to make this run silently in the background??Thanks a ton!

Submitted January 11, 2017 at 06:25AM by JarofHearts

How do you run the same function with different inputs using Promises?

I was in Callback Hell. I created a function to parse xml files by popping a file name out of the array and processing it and if there are more files, call the function again. Now I have been making my script use Promises to get out of Callback Hell but I don't know how to string together calls to the same function with different inputs. Any suggestions? Thanks in advance!

Submitted January 11, 2017 at 02:15AM by DTheDeveloper

Node 7.4 Error: Module.js: 472 (throw err;)

I am running Windows. I have uninstalled Node about 3 times already, and have tried Node 6.9 as well. I am trying to use the command 'nf start'.

Submitted January 10, 2017 at 10:33PM by NightTerror6

The MongoDB hack and the importance of secure defaults

http://ift.tt/2ifEqrM

Submitted January 10, 2017 at 08:27PM by tkadlec

The wordpress of bots; a modular Node.js framework to build great bots

http://ift.tt/2ifG1hc

Submitted January 10, 2017 at 07:21PM by slvnperron

Simple and fast JavaScript threads for Node.js

http://ift.tt/IkAYTJ

Submitted January 10, 2017 at 06:15PM by indatawetrust

How does Passport.js actually work ?

I am applying for interns and was asked how passport.js actually works.According to my understanding after the password matches (salted hash) it starts a client side session by creating an encrypted cookie and keeping all the required information (user_id) in it. Whenever a request comes it decrypts it and gets the user_id.They asked me how I will implement such a library and I gave an answer to this link : http://ift.tt/2ifeQmM my passport.js answer correct and is my purposed solution used in production ?

Submitted January 10, 2017 at 05:02PM by abkibaarnsit

Is there a way to rending 3D images in Node?

Title. If not, how would I be able to do so? There must be a way to make it run some other code to make it render stuff

Submitted January 10, 2017 at 04:02PM by timgfx

When trying to push changes using git, I am getting the following when trying to deploy through codeship

Unit Testing a Controller with http responses

HiIm fairly new to unit testing. I was wondering what would be the best way to unit test a function in my controller that deals with http responses. An example of a function is below:/**Gets all users *@param {Object} req request@param {Object} res response@param {Function} next function to call in middleware*/var getAll = function(req, res, next) {userService.getAllUsers().then(function(result) { res.status(200).json(result); }).catch(next); };I'm currently using libraries such as chai and mocha to test out my services but that was fairly straight forward as I was dealing with input coming in and output being returned. I'm not quite sure what to do in this case where nothing is really being returned but a http response is being made.I've searched for some help but what comes up when looking for unit testing with http responses seems to be more along the lines of integration tests rather than unit testing .Any suggestions for methods or libraries to unit test this kind of function would be greatly appreciated. :)edit: This is the first time im posting here so im not entire sure how to put the code above in a block.

Submitted January 10, 2017 at 02:00PM by DotaSlimz

Yarn vs npm - The State of Node.js Package Managers

http://ift.tt/2j3zrvn

Submitted January 10, 2017 at 02:06PM by hfeeri

Monday 9 January 2017

Newb question, what is const wordCount = {} ?

Does anyone know of a npm package that allows you to require a module from anywhere?

I'm looking for a package that allows you to require a module that exists anywhere in your codebase without having to know the exact path, basically:a.js ---- // this file somehow provides module "foo" b.js ---- const foo = require('foo'); // instead of '../../../lib/module/foo' This allows you to cleanly organize your project however you see fit, and to re-organize it without changing tons of require() statements.Google does this via goog.provide('moduleName'), Facebook does it via @providesModule moduleName. I don't want to use Google's because I don't like closure, and I can't find a specifically open-source version of FB's (it's embedded in fbjs & libs like React & Relay)Possible solutions might be generating the import maps for browserify, flow, etc, or symlinking tons of files in node_modules

Submitted January 10, 2017 at 02:45AM by VoiceNGO

Has anyone done browser / cursor automation in Node? Automating social media posting

I'm looking to build something to automate Instagram posts / follows / likes. Could anyone point me in the direction of what I want to use to do this?Is it reasonably straight forward to get the coordinates of a button from the headless browser and then get the mouse to move to it in a somewhat human fashion?Also, would it be smart to alter the user agent header to spoof a mobile device and hence require less mouse mimicking? If anyone's tackled this sort of project I'd love to hear about it.

Submitted January 10, 2017 at 02:35AM by ajc820

Can I use node.JS with SQLite to create desktop applications that can..you know...remember stuff? And can node.JS access files on the user's computer?

I worked with node.JS a while ago, and I've learned a lot of web development since then. I've also worked with SQLite and PHP, and I love how light weight it is. I've seen that SQLite and Node.JS are compatible, are there any resources that explain how to use them together?A related question, can node.JS access files on the user's computer? If I wanted to use it to make a music player, for example, would that be possible if the user provided a folder path to scan for songs, or something to that effect?

Submitted January 10, 2017 at 12:41AM by PM_ME_A_WEBSITE_IDEA

What is the best ORM to use that handles database-first approach very well.

Hey guys. I'm am trying to learn Node.js by rewriting my existing .NET Web Api2 project into a Node.js application and I can't seem to find any frameworks or a good documentation (Sequelize and Bookshelf) on how to handle database-first approach.

Submitted January 09, 2017 at 09:28PM by redditforeducation

Monitor NodeJS dependencies with npm-check

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

Submitted January 09, 2017 at 10:18PM by WebYourMindtuts

How does nodejs web hosting work and how do you choose the right price plan?

I'm really confused as to how nodejs hosting working. I have never hosted a node app yet and I have been looking at Heroku and Digital Ocean price plans and I don't understand what I'm looking at.How do I determine how much ram, Core processors, Transfer, etc I need? How do I choose the right host?

Submitted January 09, 2017 at 04:52PM by SparkDe

Volatile In-memory Cache

So I've been digging around looking for some in memory caches which will be a bit more performant and less difficult to wield than a big object in memory. I know about lokijs (paging /u/techfort) and lazy-cache, but I'm not sure honestly what would be the best choice.My requirements include an in-memory datastore for ~100k objects about 50kb in size each, no persistence, quick lookups, easy updates.Any suggestions?

Submitted January 09, 2017 at 04:13PM by damnedmage

Issues when selecting between a module and a "class"

I've studying node for a while and have a few projects behind my back now. I'm still not sure of one thing: When is it needed to use a "class" (prototype) and when to just export functions directly? What are the pros and cons of using modules? What are for using prototype approach? I Generally like using modules because it doesnt require me to create new objects because of the node caching system I can just require them. Can someone enlighten me when is it needed to use prototypes? I have been reading about design patterns (http://ift.tt/2jl6dEC) but this still confuses me.

Submitted January 09, 2017 at 02:32PM by tjugg

A web server inside a web browser.

Hosting a simple static web site or a list of files inside the web browser using the file API and node with websockets as a proxy. Comes in handy to transfer a few files between desktop and smartphone.working example: http://dataplane.io/git: http://ift.tt/2i8RXxS

Submitted January 09, 2017 at 03:00PM by s133pb0y

Beautiful Node APIs – by Azat Mardan, Software Engineering

http://ift.tt/2j9lwRP

Submitted January 09, 2017 at 01:06PM by ginger-julia

Sunday 8 January 2017

Wasting my time?

I originally built my iOS application using Parse (Now self hosting Parse Server).The app is done, but I had the idea to integrate Shopify and pull data from shop owners into the app.For some reason I looked into creating my own backend as I've been thinking about it since I don't want to depend on Parse.I could probably make the changes necessary for the Shopify integration with Parse, and I wasting my time trying to create my own API?When I could add the integration and get the product out there to be used. Rather than put that on hold and create an API and then rework the iOS side of things too.

Submitted January 09, 2017 at 04:59AM by farhansyed7911

can you return a value of a promise.then()?

I'm using knex to retrieve data from my db.since knex is promised based it works likefunction getSomething(){ knex('table').then((rows) => { console.log(rows); }) } in my top level function, I'm pretty much calling the function above, but I need the value of the data.actualFunction(){ test = new class(); var result = test.getSomething(); console.log(result) // always undefined; } I have tried using 'return rows;' in the getSomething function, but it still returns undefined.I think i saw an exmple of async/await that would work, but even though I'm using babel my console error showed (await is a reserved word).What is another method of getting the return of my knex function into the actualFunction()?

Submitted January 09, 2017 at 05:08AM by paOol

(koa-route + koa-mount) or koa-router

I'm starting a koa2 project and trying to decide which router to use. Anyone have any experience with the advantages and limitations of either? Coming from express, koa-router is familiar, but I'm curious about the standalone app approach that koa-route seems to advocate. Anything you can't do with koa-route and koa-mount that you could do with koa-router?

Submitted January 09, 2017 at 02:18AM by harumphfrog

Trying to find good design pattern for handling many different types of errors (mongoose, redis, express) in a REST API

Title says it all. I built and launched my first production API using express, mongoose, and redis a few months ago and one of the things that I was really unhappy with was my error handling code. Right now it just looks and feels like a giant mess. I'm trying to find a way to cleanly organize all of the possible error handling I could want to do, especially when using libraries to utilize various tools like mongoose for mongodb and the node redis module for redis. You can have so many different types of errors, especially with mongoose and needing to validate and sanitize user input from the client. I've been doing research on this subject and the examples I can find are usually way too simple and also it seems that it's very hard for everyone to agree on something.This new API that I am currently working on is not that big, but at the same time it's not just a simple side project so I would like to find a simple and clean way to handle these errors this time. So far the only thing that I think I know for sure, is that I want to have an errors.js file with custom functions or constructor functions that I can funnel all of my errors into when they happen in my middleware or my controllers.I did come across some really good StackOverflow questions in regards to managing mongoose validation errors, but the I'm not sure how valid the answers are or if anything is outdated as things seem to change so rapidly in node:http://ift.tt/2iSeQaR put it simply, I just need a way to handle all types of errors in general, but also a clean way to manage things like validation errors from mongoose, and also general errors when interacting with redis. Right now I have some nasty code in my controllers and middleware and I'd love to find a better way to organize it. I'd also like to be able to end up with a nice json response for the client, that in some cases has a specific error message to show the user eg. signup validation error.I realize there are multiple ways you could handle this, but as someone new to node and building API's, I'd love to hear, even at a high level, how all of you have approached the problems I'm describing and what your solutions look like.As always thanks for the help!

Submitted January 08, 2017 at 07:48PM by m9js

Using a JSON file as a database returns data faster then a dedicated Mysql server?

an example data block from the JSON file.{ "Name": "testing", "Private": "yes", "Project_Index": "index\r\nproject.json\r\nextras", "Readme": "", "Contributors": "everyone", "Creator": "myself", "Language": "", "Version": "all the versions", "UsernameDB": "", "PasswordDB": "", "Comment": "", "UserCommented": "", "TimeStamp": "0000-00-00", "Project_comments": . } There are a few hundred blocks like that, of varying sizes, the code requires it like a module, then loops through it until it finds a match then returns the block that contains the match. Its nearly twice as fast as MySQL, with the same data, I exported the JSON data directly from Phpmyadmin so the data is exactly the same. Is mysql just slow or does JSON just better for my purpose? Any input appreciated, I am kinda confused on this. Thank you.

Submitted January 08, 2017 at 06:08PM by OzziePeck

MongoDB Apocalypse Is Here as Ransom Attacks Hit 10,000 Servers

http://ift.tt/2insnq0

Submitted January 08, 2017 at 06:31PM by pier25

Request for help/contributions etc on a project. Primarily an opinion on the idea, if it will be useful any where or not. Thank you!

http://ift.tt/2iRkHiC

Submitted January 08, 2017 at 04:09PM by OzziePeck

Free NodeJS tool to host a private HTTPS server on your device and expose it with beame-insta-SSL

http://ift.tt/2dLYd06

Submitted January 08, 2017 at 02:46PM by beame_io

Looking for a lightweight persistent database (which ISN'T in-memory)

Hey guys,So I'm looking for a simple lightweight database that persists on disk for use with an Electron application I'm working on. I looked at NeDB, but found out that it keeps a copy of the database in memory at all times -- and this won't work for me because I'm expecting an extremely large number of records, and MongoDB isn't something that you can just bundle as part of an Electron app.Do you have any suggestions for me?

Submitted January 08, 2017 at 09:28AM by i-hate-animals

Saturday 7 January 2017

Which Nodejs ORM to use for MariaDB with transactions support?

There are so many options: Sequelize, node-orm2, bookshelf, waterline(no transaction support). Can you guys let me know which one do you prefer and why?

Submitted January 08, 2017 at 06:47AM by dejavureddit

Deploying node app

Hi there. I've used previosly capistrano to deploy my rails app to remote vps. Now i'm working with node apps. What library can i use to have this same flow: i push to github, trigger locally deploy , library calls remote agents, makes them pull changes, build app and assets and restart server. Or this is not really good? What is the modest approach?

Submitted January 08, 2017 at 02:02AM by zmii73

Need help doing a join with mongodb driver

http://ift.tt/2ipF2sq want to do this but I cannot find an example using node module.

Submitted January 08, 2017 at 02:34AM by agentf90

Implementing the IRC spec in Node.js or Why reading RFCs doesn’t have to be scary

http://ift.tt/2gWwtY5

Submitted January 08, 2017 at 03:11AM by fagnerbrack

rword - Real English Word Generator

http://ift.tt/2iUyLbT

Submitted January 07, 2017 at 09:34PM by MrXyfir

JavaScript APIs: Console

http://ift.tt/2iUb8Qw

Submitted January 07, 2017 at 08:40PM by PM_UR_DISSERTATIONS

ExpressJS, Socket.IO & AngularJS Boilerplate

http://ift.tt/2i4fseS

Submitted January 07, 2017 at 06:23PM by jozefbutko

Friday 6 January 2017

any ways to filter tcp/ip responses easily?

I want to build something similar to HTTP Scoop (easy to use http sniffer for MacOS).I've come across a few modules but they all seem to be very outdated.tcpdump, tcpdump-parser, node-pcapall these projects seem dead to me.

Submitted January 07, 2017 at 07:20AM by agentf90

I have a rest api working with being able to create users, with bcyrpt. Whats next? How should i go about login, reset etc. ?

Wondering what i should do next, I have a user model along with the ability to POST to /user to create accounts with the password hashed.I would like to know what is the next steps? How do I go about logging in, sessions etc.If theres a guide on this i'd appreciate it.Thanks

Submitted January 07, 2017 at 03:22AM by farhansyed7911

Passing values from Python to Node Red?

I'm working on a Raspberry Pi LED project.I have a simple Python/Flask script that controls 4 LED, to turn on any LED i just pass http://myIP:5050/{LED}/{PWM} to my browser, where LED is which LED and PWM is the value of duty cycle of PWM.I have a dashboard setup in Node Red that shows the status, I want to have the status of LED to show there (on/off, beside the Light 1 label I have there) and have no idea how.This is the first time I'm using Node Red, any help will be greatly appreciated

Submitted January 07, 2017 at 01:06AM by theonlyQuan