Wednesday 28 February 2018

Is there a way to get the client windows username?

All of my attempts so far either only get the server windows username or they prompt users to enter their windows username and password.Is there a way to get the windows username of the client without any prompt to the user?Thanks in advance!

Submitted March 01, 2018 at 12:14AM by pzea

updating a package

Hello,What is the difference between:npm update [package-name] andnpm update -g [package-name] Which one is recommended?

Submitted February 28, 2018 at 10:27PM by androidjunior

Looking for a JIRA alternative for personal life/use

Is anyone aware of a free/cheaper JIRA alternative? Looking for something for personal use. JIRA isn't poorly priced, but figured id someone knew of something similar for cheaper (or preferably free) before I got into that.What I like about JIRA:Being able to make Projects and place Epics => Tasks inside of it.track how long I spend on different items vs. how long I thought I wouldVisualize how long something will takePotentially, invite other users to see and help.This is not just for programming, I wanted to try and expand my work task management style to personal life and track hobby progress as well as household repairs that need to be taken care of. I'm looking at Todoist now but am not sure if thats exactly what I am going for.I know this is the node subreddit, but I figured you guys would know what I meant.

Submitted February 28, 2018 at 09:48PM by mrcelophane

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

http://ift.tt/2F4tC8Y

Submitted February 28, 2018 at 06:12PM by Abjonse

How to Build a URL Shortener with Node.js and MongoDB

http://ift.tt/2GSOvV3

Submitted February 28, 2018 at 04:46PM by andreapapp

How to convert a pdf having a table to xls using node.js

http://ift.tt/2HSB08U

Submitted February 28, 2018 at 04:46PM by Aspose-PDF

When to use CQRS?!

http://ift.tt/2FAYtuB

Submitted February 28, 2018 at 04:45PM by andreapapp

TypeScript — JavaScript with superpowers

http://ift.tt/2F1z7oS

Submitted February 28, 2018 at 02:45PM by thickoat

“Run” – Enabling a new generation of tools that are truly configurable, composable, and automatically installed

https://run.tools/

Submitted February 28, 2018 at 02:17PM by mvila

any good resources to read/watch about async nature of nodeJS?

Hi I can't seem to get my head around the async.js library and now that's confusing me with my node basics also. What is the difference between async.foreach, async.parallel etc? How do I run a for loop synchronously in nodeJS? Only the I/O opertations are handed over to a different thread in NodeJS right? Is it possible to make a audio encoder or video downloader or something like an intensive I/O application in just node, which will serve multiple users? If someone can explain these things and give me links to some good books to read or videos to watch, it'd clear a lot of things up for me.Thanks

Submitted February 28, 2018 at 10:10AM by mclovin4009

Angular 2(or 4) and NodeJS-The Practical MEAN Stack Guide

https://twitter.com/EnrollCourses/status/963107595547496448

Submitted February 28, 2018 at 09:29AM by loneisthere

Tuesday 27 February 2018

Logged In User Only Pages? HELP.

Basically, I'm new to node and I set up login and register. Register puts a user into PostgreSQL database and login obviously checks if the user is in the database but now I'm stuck how do I let logged in users go to an only logged in user page? I'm sorry If I'm not explaining this properly.

Submitted February 28, 2018 at 12:57AM by PseudoProgrmmer

Node lovers, we need you to create the first “resources”

https://run.tools/

Submitted February 28, 2018 at 01:19AM by mvila

Need to Node - Volume 2

http://ift.tt/2GQkqoO

Submitted February 27, 2018 at 10:38PM by _bit

Sending form data to nodejs server

I am trying to achieve a very basic thing but couldn't find any proper documentation or example on the web somehow (probably my bad).I have a very basic HTML form. This form lies on http://localhost:3000/post
Company Name:

Job Title:
When I submit it, I want to pass this information to my nodeJS server, which is running on port 3001.I tried something as follows to at least see what's going on but no luckconst express = require('express'); const cors = require('cors'); let app = express(); app.use(cors()); app.get('/post', (req,res) => { console.log(req,res) }) app.listen(3001);

Submitted February 27, 2018 at 09:19PM by eligloys

a drop-in replacement for glob lets you use promises or callbacks

http://ift.tt/2CsqGoE

Submitted February 27, 2018 at 08:00PM by delegoat

Node oritentated Raspberry Pi group (Discord)

http://ift.tt/2FCt4rQ

Submitted February 27, 2018 at 06:50PM by BamItsPixel

Do you use any MVC web framework for developing NodeJs application? If yes, which one do you prefer?

While I am certainly enjoying the freedom of using microframeworks like koa and express, but certain projects really benefit from the use of a full-fledged MVC solution. But I couldn't find something that is as ubiquitous as Django or Rails are in their respective community. So I am just looking for a general opinion on what do you use for such cases and why?

Submitted February 27, 2018 at 03:57PM by sioa

My next episode: we create and verify a token to protect APIs. There is still a lot of work to be done but it’s starting to feel real.

https://youtu.be/eG-OM0EtNAc

Submitted February 27, 2018 at 03:22PM by sheffmaster

Efficiently snapshotting your single-page-apps with Puppeteer

http://ift.tt/2FBJmBp

Submitted February 27, 2018 at 01:56PM by enkideridu

[request] literature regarding node.js basics for beginners

I was wondering if you guys have any links that would explain how node.js works, what its default modules are and some basic example of the usage, e.g. something like this: http://ift.tt/2HRiAFQ course, this is a bit too basic, but they got the structure somewhat right.Thanks!

Submitted February 27, 2018 at 10:50AM by JavascriptFanboy

Promises are not neutral enough

http://ift.tt/2HeOJXv

Submitted February 27, 2018 at 10:19AM by fagnerbrack

Node.js Top 10 Open Source for the Past Month-v.Feb 2018

http://ift.tt/2GNxxr0

Submitted February 27, 2018 at 09:34AM by Rajnishro

Monday 26 February 2018

1 Pain Points of GraphQL - The main issues you probably will face developing a GraphQL API

http://ift.tt/2v2FGVw

Submitted February 27, 2018 at 03:27AM by bsoares_

First node micro services I wrote are going live to 200k+ users

And holy shit I am [insert emotion here] as fuck. I've tested the shit out of everything, got all of my ducks in a row, and ready to hotfix the shit out of what needs to be done. Any other seniors remember that feeling?

Submitted February 27, 2018 at 01:46AM by shredgnarrr

Creating A Google Home App Part 3 - Refactoring and Scoring

http://ift.tt/2BRFITR

Submitted February 26, 2018 at 04:54PM by kson34

Use Ethereum to Authenticate User Login using MetaMask and meta-auth for ExpressJS

Last March MetaMask maintainer Dan Finlay wrote The New Secure Way to Sign Data in Your Browser. Or how to use the MetaMask chrome plugin to verify messages sent from a remote server.MetaMask is a browser extension that provides Chrome with an interactive Ethereum wallet. It web3 enables the browser. This authentication strategy abandons usernames and passwords in favor of signed messages - the same security used to create Ethereum transactions.This is becoming more and more popular based on sites like Cryptokitties and Bloom using your MetaMask account to identify users & tokens. I didn't see anything in npm so I went ahead and wrote an Express middleware that you can drop into your existing projects.Just add the middleware to your route, set a few parameters and the middleware will take of all the rest.Here is a write up explainingHere is the Githubnpm

Submitted February 26, 2018 at 05:39PM by WeaponizedMath

RisingStack Training Calendar for 2018 - Microservices, Kubernetes, React, Angular & Node.js

http://ift.tt/2F9JRoa

Submitted February 26, 2018 at 03:45PM by andreapapp

I just posted my next episode, building the verify email and login handlers in HapiJS. Please let me know what you think.

https://youtu.be/yFVJeaQTFpc

Submitted February 26, 2018 at 02:52PM by sheffmaster

Adding Real-Time in Strapi with Socket.io

http://ift.tt/2EVvdBJ

Submitted February 26, 2018 at 12:32PM by Dandynvor

Machine Learning toolkit for Node.js + Browser. By Ryan Dahl, the creator of Node.js

http://propelml.org/

Submitted February 26, 2018 at 12:52PM by kapv89

Introduction to Javascript Promise - Converting Callback functions to Promise aware APIs

http://ift.tt/2ERYpJP

Submitted February 26, 2018 at 11:26AM by nodexplained

[Question] How to terminate a Server Sent Events session?

I intercept a request using express (which I use to handle other routes), then initiate a SSE session by directly setting headers on the response:res.writeHead(200, { "content-type": "text/event-stream", "cache-control": "no-cache" }); I proceed with writing intermittent payloads using "res.write()".** It's worth noting that since I don't report a "content-length", Node automatically assumes "chunked" transfer encoding (this shouldn't be a problem AFAIK). It also defaults to "connection: keep-alive".This works well with Chrome's EventSource, up until the point when I call ".close()" to end the session. Then, the connection keeps hanging: Chrome doesn't reuse the connection to initiate additional EventSource requests (or other), and node doesn't supply a "close" event on the IncomingMessage instance.My question is: How do I handle "eventSource.close()" properly using node's http entities?

Submitted February 26, 2018 at 10:40AM by tweinf

Issue with YTDL on discord bot

i got this working for my discord bot but i want to make it that if you search the name of a song it will get the song instead of needing a URL. PLS HELP

Submitted February 26, 2018 at 06:56AM by Zuilt

What CI/CD is right for me?

I am using Razzle, so my usual deploy process is(from the server)git pullnpm run build (webpack build)pm2 start mynodeserver.jsthe problem is that when I do this, there is a period where webpack is compiling and building and my site is effectively "broken" during this process where assets fail to load and things break on the front-end.It's only for a minute or so, but It's still a big problem for my users. especially with no warning.Which tool will handle this for me?I care more that there is no "downtime" than anything else.

Submitted February 26, 2018 at 06:15AM by paOol

Sunday 25 February 2018

coroute - The awesome Node.js HTTP reverse-proxy server

http://ift.tt/2CJL54l

Submitted February 26, 2018 at 12:44AM by Etha_n

My first NPM package! What do you think?

Hello.At work I ran into a situation where a legacy api expected photo uploads as json with the picture as a field in the object encoded in base64.Our server had to remain efficient, and some of the images could be quite heavy. It was not practical to load images in to memory so as to be able to set the data on an object and pass that to request-promise or what have you.I found a solution on npm to stream objects as json strings but it was quite buggy. So i wrote my own version of the solution. If anyone want to have a look at it and comment that would be great.Here is the link! Hopefully it helps someone with a similar problem.Be gentle! :)

Submitted February 26, 2018 at 01:12AM by davidmdm

Machine Learning With NodeJS

https://youtu.be/iumlHzoVlJM

Submitted February 25, 2018 at 09:50PM by jfishersolutions

Enabling 'Citizen' Developers

I've been working on a nodeJs app (a cdripper). I'd like to include userspace (~/app_cfg.js) code/config to enable 'citizen' developers to configure, tweak or extend via a single native nodeJs source.What is a good way to enable 'citizen' developers, w/out requiring them to modify the raw source code?Do any have any practical experience/suggestions for a good way to do this? Are there frameworks or libraries to consider?

Submitted February 25, 2018 at 08:56PM by ConstVoidBlog

Standardizing Node.js Version in an npm Package

http://ift.tt/2sLNVpG

Submitted February 25, 2018 at 08:28PM by nitayneeman

Testable modules in node

http://ift.tt/2HH80Bb

Submitted February 25, 2018 at 11:54AM by bmf___

[Question] Node modules, typescript and private git repo

Hey guys, I've been thinking of switching over this decently sized project over to Typescript, but I wasn't sure how and when it would get transpiled to JS when I deploy it since I'm using a private git repo.I noticed that something such as the Google APIs module it uses the prepare script which npm documents here, but I don't think I'll be able to use this with a private git repo.Is it possible to make my module compile to typescript in production install without the need of using a npm repo or committing compiled and production ready code into my private repo?Sorry if my question is a bit unclear.

Submitted February 25, 2018 at 10:31AM by acylus0

Passing variables from request module

I need a little help here. I'm new to Node and I'm trying to use the request module and pass a variable named state. The variable works just fine and shows the correct value when I call it from within but if I call it after the }); for the module, it's null. Would someone be able to point me in the right direction?Thanks. request({url:'http://ift.tt/2oo8AM2 queryData.apikey,method:'GET',json:requestmsg},function(error,response,body){ if (cmd == 'lightstatus') { var state = body.result[0].deviceTypeMap.garageLight_7.at.lightState.value console.log("lightstate:" + state) } else if (cmd == 'doorstatus') { var state = body.result[0].deviceTypeMap.garageDoor_7.at.doorState.value console.log("doorstate:" + state); } }); response.end(state)

Submitted February 25, 2018 at 07:54AM by madj42

Question regarding error handling in express

Hello guys.Is it a good idea not to pass error codes like 401, 403, 404 etc like (res.status(404).json(error)) but instead always have a 200 status but use a flag in the response to check whether it was success or reject and message (for example res.json({ success: false, message: "Something went wrong on the server"})) and then catch those messages on the fronted also based on this flag( promise.then(response => { if (response.data.success) }) etc, instead of dealing with errors in catch.Is this bad? I hate having errors in console and dealing with "catch" in the promise and approach i wrote above looks much better to me, easier to handle, and I send my own messages instead of dealing with complex structured, deeply nested error codes and stuff.Thanks!

Submitted February 25, 2018 at 09:31AM by nikola1970

Saturday 24 February 2018

Alibaba Pandora.js – A Manageable, Measurable and Traceable Node.js App Manager

http://ift.tt/2k11cDg

Submitted February 25, 2018 at 03:04AM by WongAllen

How do you manage your Postgres functions, views, and triggers in your codebase?

Knex (http://ift.tt/1wiuqh0) has been a dependable tool for database migrations, but I'm at a bit of a loss on how I should go about managing my custom functions, views, and triggers.Managing them in migration files seems crude... it would force me to rollback for any small change I make to a Postgres function... ideally, every function, view, and trigger would have it's own file in my codebase. If a file was edited, the function, view, or trigger would drop then reapply its updated version to the database.PGrebase (http://ift.tt/2f0KGP8) appears to be more in-line with what I want, but a.) has limited community support and b.) is written in Go.This seems like it would be a very common problem for developers to run into, what is the Node Way™ of handling this?

Submitted February 25, 2018 at 02:05AM by samosa_samsara

Project Suggestions for Learning Node

I'm currently learning javascript and the MERN stack. I've done a number of udemy courses and built a few of my own MERN apps, most of which have essentially been CRUD apps.On the Node side of things, aside from learning express, authentication and different database technologies, I'm not sure what other projects I should be working on to add depth and breadth to my Node skills.Any suggestions for practice projects that would help me push my Node skills to the next level, and learn things that will be useful to me in future jobs?Any advice is appreciated, but I guess I'm really looking for suggestions like "you should build an app that does X, because it will force you to learn Y and Z" (where Y and Z might be coding techniques, key node modules etc).Thanks!P.S. I am definitely also working on JS fundamentals. I'm asking more about Node-specific skills, such as use of the File System module or whatever else.

Submitted February 24, 2018 at 10:10PM by rollickingrube

Socket.io and memory usage

Who can explain me why node.js and socket.io working this way: 1. Starting the process = 150mb used (Serving about 2000 connected clients.) 2. Waiting some time... 3. I see a spike in CPU usage and memory consumption rises to 300mb 4. After 24hrs it will be about 500-700mb but stable. Node never releases memory.Staring with: rss: 179134464, heapTotal: 98697216, heapUsed: 67785728, external: 57122913Then rss becomes about 500-700mb but heapUsed +- stable. Inspected the app - no memory leaks in the code.Thank you.

Submitted February 24, 2018 at 05:15PM by TwoMovies

Health Checks and Graceful Shutdown for Node.js Applications

http://ift.tt/2F3lg4E

Submitted February 24, 2018 at 04:42PM by gorgerson

Building a Socket.io chat app and deploying it using AWS Fargate

http://ift.tt/2E4y89X

Submitted February 24, 2018 at 09:40AM by ginger-julia

How To Speed Up Continuous Integration Build With New NPM CI And package-lock.json

http://ift.tt/2olWxPc

Submitted February 24, 2018 at 09:45AM by harlampi

Friday 23 February 2018

Learn How To Create A Basic Server & API with NodeJS

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

Submitted February 24, 2018 at 01:55AM by jfishersolutions

Building a Node.js WebSocket Chat App with Socket.io and React

http://ift.tt/2EP7XRY

Submitted February 23, 2018 at 09:44PM by Happycodeine

How to use a shell script to run node.js files?

Hello, I am trying to execute node.js from a shell script. Anyone know why this is not working? The node.js files are in the same folder I am running the script, but it says cannot find module. Heres my code.!/bin/shset -xexport EB_TOKEN='99FASDOFHIOEWEOE0D'sleep 5node build.jssleep 5node updateEvents.jssleep 5node updateArchive.jssleep 5

Submitted February 23, 2018 at 06:47PM by PleaseTheWalrus

Node streams, are they lost in the current node community?

As stated in the title, I feel that streams ate lost on the node community.Why am I bringing this up in a time of promises and async/await?Simple when you stream data you get to connect your streams in a "syncronous" fashion via pipes. With the Advent of transform streams it seems unnecessary to use Asyn/await everywhere (besides external API calls). In alot of cases you can pipe your transformations together and avoid "callback hell". They come with back pressure and you can control the byte iterations as you please.I also haven't seen any new uses or "tutorials" on streams in a long time (1+ yr?).So I thought I'd bring this topic back up. Mainly so new users to node can become aware of streams as well as revive a discussion about streams and their use cases.Also if you aren't aware this amazing repo about streams is still relevant. http://ift.tt/TNpydO

Submitted February 23, 2018 at 03:40PM by TheOneRavenous

Weekly Node.js Update - #8 - 02.23, 2018

http://ift.tt/2ENcLam

Submitted February 23, 2018 at 02:42PM by andreapapp

How Node based on ChakraCore is different from existing Node on V8? What will be eventually result of Node built up on two engines?

I am not able to get the idea of how two engines will influence Node. Maybe I lack in depth the idea of JS Engine, enlighten me on this.

Submitted February 23, 2018 at 02:07PM by vivlam

Node.js experts wanted for collaboration with TestDome

TestDome.com is a site for automated testing of programming skills based on work sample tasks. We would like to expand our tests to Node.js. Therefore, we are looking for several experts who would help us decide which Node.js topics are relevant in today's job market and to write questions. As a token of appreciation for helping us select the relevant topics, we offer $100 Amazon gift card. Also, for every question we accept, we offer $100 Amazon gift card. You will be visible as the author of the questions (like http://ift.tt/2ELh1eK). If you are interested in helping us, send me an email to davor@testdome.com with your name and credentials as Node.js expert.

Submitted February 23, 2018 at 12:52PM by DavorCu

My microservicing concept

Hi guys,I started developing my own microservicing framework since I did not find anything that quite fit my needs.What I wanted was realtime communication between my services and good monitoring and fail detection with retry.First thing I really did not like about existing solutions was HTTP.I think establishing connection every time is overhead for no reason.Instead, I have decided to use redis cluster where I have persistant connection to it and socket is ready to send data at any moment.I have decided to make it more-less basic and only features I created by default are timeout, fail detection and retry (with TTL).For monitoring, I made sure anything worker does is sent to messaging channel so, my separate monitoring service can track state of every single job.In case of failure of my framework, monitor would recreate that job to make sure task is completed (finished or failed).To really use as much of resources as possible, my framework has ability to start multiple node processes and forward them tasks.I was wondering if anyone here had any other ideas for what I could do?Also, job of monitor would be to log any errors with full stack of service calls and arguments.http://ift.tt/2sLJFGV info: http://ift.tt/2EXXYwP

Submitted February 23, 2018 at 01:32PM by nemanjan00

[Question] Executing Node.js on Hacked Linux Server?

Hello Node-Community,I am quite new on Linux (using Ubuntu) and do set up a (physical) server right now on which a node.js web-application should run. Sorry in advance if I confuse something here.I made a user under which node will be running. The user is already restricted so that he can only read/write/execute files in his home directory and he can execute Node.js with all the network permissions a node-server needs.If my server theoretically gets hacked and someone gets user-level access, he can write and run node.js-code on my server and use my web-application for bad things (Distributing viruses, phishing visitors, ...).Is there anything I can do to prevent such an attacker to execute his own code?Even if I make everything read-only, the attacker can still run code with the node shell-command, right? Is there a way to configure node.js to only run code from (certain) directories or something?

Submitted February 23, 2018 at 01:42PM by SylooxD

Matteo Collina: My Node.JS Process Is On Fire - JSConf.Asia 2018

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

Submitted February 23, 2018 at 07:56AM by harlampi

Course Announcement: GraphQL with Angular & Apollo

http://ift.tt/2CcPOzG

Submitted February 23, 2018 at 07:59AM by codingthesmartway

Node.js Ops First with Pandora.js, Today

http://ift.tt/2HGOrci

Submitted February 23, 2018 at 09:05AM by WongAllen

Thursday 22 February 2018

Node v9.6.1 (Current)

http://ift.tt/2CDQIkN

Submitted February 23, 2018 at 04:18AM by dwaxe

Knex/Express: how to log query with data from request?

I am new to Node and not quite sure how to do this. I need to save to the database what query was ran by what user. I am able to save just the query itself by listening to the response-query on the single Knex object i.e.knex.on('query-response', async (response, obj, builder) => { const sql = builder.toString(); await saveToDatabase(sql); }); Then, any query that I run with Knex gets persisted to the database. All that works.However, now I need to save the user id as well. The user id is on the req object in my Express pipeline. How do I get it into my code that saves what query was ran by the use? I had originally tried creating an Express middleware that sets up the listener on the Knex object and then removes it once the request has completed, but I think that has concurrency issues.Is there any general (or even specific) advice for how to handle this problem? I've been doing .Net for a long time now and ASP.NET mostly solves this kind of issue for me. I also think it wouldn't be a problem if the Knex object wasn't a singleton but the docs sayInitializing the library should normally only ever happen once in your application, as it creates a connection pool for the current database, you should use the instance returned from the initialize call throughout your library.

Submitted February 23, 2018 at 02:10AM by clockdivide55

Learn Javascript By Creating A Library For A Deck Of Cards

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

Submitted February 23, 2018 at 02:22AM by jfishersolutions

A Knex.js ES6 Migrations How-To

http://ift.tt/2CeEqDA

Submitted February 23, 2018 at 01:07AM by scttmthsn

Can a package determine if it's being installed by NPM?

No text found

Submitted February 22, 2018 at 10:31PM by calligraphic-io

A request for help with DeltaBot's code - we need to get these issues fixed! • r/changemyview

http://ift.tt/2EKGXms

Submitted February 22, 2018 at 10:51PM by Snorrrlax

Machine Learning in Javascript?

Does anyone know any Node modules for doing Machine Learning and Data Science in Javascript? Much like the Numpy and Matplotlib in Python?

Submitted February 22, 2018 at 11:15PM by nickkrisa

I'm learning ReactJS, and I'm completely overwhelmed by the state of affairs when it comes to JS Back-end technologies

I have some past experience dabbling in things like codeigniter, laravel, and .net mvc, but I skipped this whole front-end js revolution. I knew a bit of Jquery, but I took up a job in a tangential area that doesn't really have me coding anymore, but it's a passion of mine so I've been doing a ReactJS course.I've finished it actually, and I'm looking to learn about the back-ends that are available. With .net and laravel, you get scaffolding, migrations, an ORM, and you get to define models and have the rest taken care of it. On top of that, they have some nifty capabilities as far as authentication, cookie management, and login stuff is concerned. Forgive me if this is a bit off, but that's what I remember of them anyways.Taking a look at what I can pair with ReactJS, it's waayyyy too overwhelming.There is Express. It seems it would make sense to pair this with an ORM like Bookshelf, or Knex or whatever. But it's still pretty basic.But if you're developing an API, they say to use Strongloop or Loopback.But then if you do more digging, you also find out about GraphQL, so GraphCool, Postgraphile, etc. Honestly this is pretty cool since you can keep a logic close to the database, but it's probably not as flexible as the other options above if I have heavy business logic.I don't imagine the apps that I make will need anything more significant than a basic CRUD api perhaps with some business logic based on my models, and user authentication./r/node what sayeth you to this fragmentation. For someone who wants to create apps quickly, that wants the convenience that .net and laravel, but wants to adapt that to work with the ReactJS framework is there one solid way to learn. Or do I have no choice but to slowly try and use all of these until i find a full-JS stack configuration that I like..And what in the fuck is up with the popularity of MongoDB?? I get it, if you only have one "type" of data it could work. But if you're developing an app where it makes sense to have different tables, wouldn't you want to use a database and framework combo that lets you configure hasmanythroughwhateverthefuck that laravel has?I'm posting this in Node, because a vast majority of JS "back-end" technologies seem to be based on it.

Submitted February 22, 2018 at 09:20PM by tradesinvancouver201

Javascript Challenges - Beginner to Advanced (work in progress)

http://ift.tt/2sKzGlh

Submitted February 22, 2018 at 09:29PM by rawnly

[Question] How to remove double quotes from Sequelize query?

http://ift.tt/2EYL5mh

Submitted February 22, 2018 at 09:40PM by Cedricium

Debug V8 in Node.js core with GDB

http://ift.tt/2k0bhys

Submitted February 22, 2018 at 09:41PM by Angelareh

Tutorial to building a WebSocket based Chat App with socket.io and React

http://ift.tt/2olhtG4

Submitted February 22, 2018 at 08:40PM by justadudewhohacks

Node v9.6.0 (Current)

http://ift.tt/2EYY07y

Submitted February 22, 2018 at 06:18PM by dwaxe

Avoid running NodeJS as PID 1 under Docker images

http://ift.tt/2CErP8k

Submitted February 22, 2018 at 05:36PM by ghaiklor

JavaScript Digest Retweet NiM Plug Wes Bos

https://twitter.com/june07t/status/966581808480501760?s=09&

Submitted February 22, 2018 at 02:44PM by alias_willsmith

npm v5.7.0 critical bug destroys Linux servers

http://ift.tt/2Cc77km

Submitted February 22, 2018 at 11:35AM by Heroiini

What's the point of package-lock.json when it's not 100% idempotent if no changes are made to package.json depdencies?

I've noticed this repeatedly recently, and it doesn't seem right to me, but maybe I'm misunderstanding, or there's some other underlying issue.My understanding is package-lock.json file ensures that the same version of a specific dependency is installed each time, so a subsequent install of the project on a different machine occurs, we as developers can be sure that we're working with the same version of dependencies, so if a new version of the dependency is released (and matches our semver specification in package.json) we won't automatically pick up that one instead, potentially leading to different behaviour between machines.What I'm finding is that when I'm checking out a new project, and run a standard npm i, it's making changes to package-lock.json. Now most of these are adding an integrity and/or dev field into some entries - now I'm thinking this is just due to people working with slightly older versions of npm which do not add those fields when installing new dependencies, which is more understandable.What I can't understand is why it will remove entire dependencies at times (I'm talking specifically about fs-events), now I think that fs-events doesn't get installed on my machine, because Windows, where as it might get installed on our Mac developer machines. Okay, that's fine, it's not compatible with my OS, so I don't get the actual dependency installed, not a problem, but what it then does is remove the entire entry out of package-lock.json, along with any items it depends on that no other dependency does - which does not seem okay, because on committing that change, I'm changing the dependency graph for the Mac developers, who then might get a different version of fs-events the next time they install from fresh.What am I missing here? Or is this just a flaw with package-lock.json and npm? I've never encountered this issue when using yarn, but it was decided for work projects that we would use npm instead of yarn.

Submitted February 22, 2018 at 07:36AM by Nysosis

Wednesday 21 February 2018

Node.js in 1 Hour

https://youtu.be/TlB_eWDSMt4

Submitted February 22, 2018 at 02:29AM by mhamedani

Advices for an online Card Game

Hey guys, I'm working on an online card game project and building it with nodejs. I will use Clusters and some TCP (With the net module), but I need to share the game state (and/or clients/tcpsocket) between each Clusters, to do so I'm thinking about storing the game state into mongodb. But is there more effective here ? And will MongoDB handle many requests per seconds to get and modify the game state with very low latency ? Edit : I'm talking about the back end part

Submitted February 22, 2018 at 02:01AM by velrodd

a simple tool to learn promise status

http://ift.tt/2HzHnxZ

Submitted February 21, 2018 at 07:39PM by indatawetrust

Uphold API integration with Node.js

Hello Everyone I want to make a simple web app where one user cand send money to a lot of users with Uphold API please if someone is related with the usage of this API please add me on skype or tell me what do I have to understand to make it possible. Thanks and greetings

Submitted February 21, 2018 at 08:09PM by Deivbid

Nodejs with full-icu

http://ift.tt/2CbrUVc

Submitted February 21, 2018 at 08:40PM by safeTell

Looking for some feedback on a webscraper I built

Hello, I built a webscraper to scrape job listings from a few different sites and I was wondering if anyone would give me some advice on how the code looks, ways to refactor it, the structure/architecture of the app, stuff like that. Maybe some UX advice as well. Here is a link to the Github repo, and the UI is hosted Here. The backend is written using Express, and DynamoDB. The UI is built using React. I don't know where to go for some code review so I thought I would try here! Thanks!

Submitted February 21, 2018 at 08:49PM by El_Stump

Node Typescript testing

Hello! What do you guys usually use for testing a nodejs project written in typescript?

Submitted February 21, 2018 at 08:55PM by entregrammer

Need help with authentication for a Koa app.

I am learning webdev with Koa and currently trying to complete a project on my own. For authentication, what I do now is, whenever a user signs up or logs in, I take the unique user id from the db, encode it in base64 and then sign it as jwt and send it back as a JSON response. This is done by a set of auth routes. After these auth routes, I have an authorization middleware that checks whether the Request headers have the 'Authorization' field and if it does, it verifies the jwt and checks whether the id is present in the db. If it is, it stores the user details in the ctx.state or else it throws an error. Does this sound like a good strategy? Am I doing something wrong? Any place to improve?

Submitted February 21, 2018 at 02:40PM by sioa

lightweight "tracking" packages?

I use morgan for logging and I'd like something similar to "track" users based on their ip/useragent etc,.Basically, need a way to count unique views on my site and if there is a package already for this, that'd be awesome.otherwise, i am thinking of streaming each GET request to specified endpoints, writing the user agent and info to a file, and after X hours, I delete duplicates and batch insert the results into my database.(to prevent constantly writing to the db).I am using reactjs on the front, and express in the backend.any advice would be appreciated.

Submitted February 21, 2018 at 03:10PM by sayurichick

Node.js is the Best Framework for App Development, Know Why?

http://ift.tt/2BJ12Lu

Submitted February 21, 2018 at 01:06PM by Biztech_CS

Node.js event loop workflow & lifecycle in low level

http://ift.tt/2oigDsS

Submitted February 21, 2018 at 12:58PM by sarslanhan

Logging in microservices: how to connect logs between Node.js services

http://ift.tt/2Fi5bWg

Submitted February 21, 2018 at 09:32AM by blacksonic86

Just finished this course and I have to admit this is the best and one of the most complete courses on Node.js. It's a big course and will take a while. Be sure to give yourself 15-30 minutes everyday to go through the sessions and definitely do the challenges.

http://ift.tt/2EHKMsw

Submitted February 21, 2018 at 09:49AM by alerrce

Tuesday 20 February 2018

Need feedback on project dealing with monitoring the event loop.

Hey everyone I’m part of a small team of developers who will be spending the next few weeks creating a tool to benefit the Node ecosystem.We're interested in doing something with monitoring the event loop.Using async hooks and performance hooks we are thinking about creating a tool that shows you how long each async call and subsequent calls take in the event loop. Given any user's experience with Node, do you think this is a reasonable idea? If so what other metrics or information do you think would be valuable for developers?If not, what developer tool do you wish the Node ecosystem had?Thank you for your time; my team and I really appreciate your feedback!

Submitted February 21, 2018 at 01:19AM by iamkuni

TIL whenever "await" is called, node.js call stack is blown away because of process.nextTick being called

http://ift.tt/2EWyy2L

Submitted February 21, 2018 at 01:13AM by Capaj

Node.js + MongoDB | simple location controlled driver application (Heroku + Travis CI)

http://ift.tt/2omdE2K

Submitted February 20, 2018 at 10:12PM by indatawetrust

Can anyone verify this is legit installation file?

I installed node yesterday, learning it because I decided it has the functionality needed for a project I'm starting.On my laptop, I dont use wifi. However after installing node,npm,express,and request. I see this file in my recent accessed files.I tried finding the exact source code if this is legit, but couldnt.Does express/request come with files to manipulate wifi? Is this legit? Thank you for reading.http://ift.tt/2odOSSZ

Submitted February 20, 2018 at 07:05PM by bifoldmanifolddouble

How to test a Node + Angular app bundled on the same server.

How would i go about testing a app that's bundled together.My express api + angular run on the same port with different end points.http://ift.tt/2Gxgd9H entry point is bin/wwwAny tips as to what direction my search should go is appreciated.Thanks

Submitted February 20, 2018 at 06:42PM by NeedMoreMuscle

Need to Node - Volume 1

http://ift.tt/2HueGCm

Submitted February 20, 2018 at 07:10PM by _bit

Business guy turned noob developer. Would appreciate some feedback on my first web app!

Hello /r/node!Been a long time lurker, and as a self taught developer, I appreciate this community for all the helpful discussions. I want to share a small project I've been working. I would appreciate any feedback and input on areas of improvement. Thanks in advance!The Problem:I'm subscribed to 25+ subreddits, and have a hard time keeping up with new posts. My Reddit feed is dominated by a few large subreddits and I end up just scrolling aimlessly.The Solution:I created a web app called Reddit Daily that sends you daily summary of the top posts from your favorite subreddits.Main questions I have:Would this tool be useful to you?What are some features I could add / improve upon?About me:27 y/o with a background in management consulting. Currently work for a F500 insurance company in NYC. I’ve always wanted to be an entrepreneur, but hated being the “business guy”. So I started learning web development ~2 years ago. It’s been a slow process due to 60-80 hour work weeks and a few false starts / going down the wrong paths (looking at you MeteorJS).

Submitted February 20, 2018 at 07:02PM by extrafoo

How Fintonic uses Node.js, MongoDB & Kubernetes to scale

http://ift.tt/2GutQq4

Submitted February 20, 2018 at 04:36PM by andreapapp

Stremio (Kodi alike media center) is one of the early adopters of Node.js (2013)! We have an add-on competition (prize $5000) which you are welcome to join »

Contest URL: http://ift.tt/2obQRY6 GitHub: http://ift.tt/2Cydme6

Submitted February 20, 2018 at 04:06PM by hangmeon

Gotchas When Publishing Modules in npm and Bower

http://ift.tt/2EJ4pok

Submitted February 20, 2018 at 02:57PM by gregbaugues

Issues with sequelize.create

I am trying to use model.create and it's saying that model.create is not a function. I googled around and couldn't seem to find any rmesolutions. Please note that I'm using es6 imports / exports in node via babel.model.js'use strict'; export default (sequelize, DataTypes) => { let attachments = sequelize.define('attachments', { type: DataTypes.STRING, category: DataTypes.STRING, value: DataTypes.STRING, }, {}); attachments.associate = (models) => { }; return attachments; }; controllerimport attachments from '../../../models/attachments' import to_attachments from '../../../models/to_attachments' import AWSService from '../../utils/awsS3Api' export async function createPhoto(ctx) { ... try { let attachment = await attachments.create({ type: 'image', category: imageCategory, value: data.location }); ..etc What am I doing wrong?

Submitted February 20, 2018 at 01:57PM by quesurfin

How to automate scripts in Node?

I'm making a dating app. Every day at midnight I want 'new matches' to be randomly found and displayed to a user.Could anyone give high level overview of how this would work?Thanks

Submitted February 20, 2018 at 09:35AM by harrydry

GraphQL-to-MongoDB, or how I learned to stop worrying and love generated query APIs

http://ift.tt/2EOB8Id

Submitted February 20, 2018 at 08:17AM by r-wabbit

Monday 19 February 2018

swag-for-dev

http://ift.tt/2BA9nky

Submitted February 20, 2018 at 04:45AM by ratancs

A minimal service to check whether a site is 🆙 or broken.

http://ift.tt/2obXPfF

Submitted February 20, 2018 at 12:17AM by _k4m4_

Can you pass command line args to a module during “require”

I want to create a library that can be required as const lib = require(“lib”) with a certain command line arg AS IF it were called as node lib.js defaultval, without having to pass it to the file where it’s being called.Sort of something like const lib = require(“lib defaultval”)Is there some setting in package.json that can be manipulated for this purpose?

Submitted February 19, 2018 at 10:31PM by alfredmuffin

Sqreen wants to protect Node.js apps

http://ift.tt/2sCqWgU

Submitted February 19, 2018 at 11:20PM by ecares

JS on Backend in 2018. Tutorial on ExpressJS. Part 2. Adding a database and Sequelize ORM.

http://ift.tt/2Fgzz3o

Submitted February 19, 2018 at 09:51PM by graffzon

Help with nodejs webserver and http-proxy

Hi folks, can anybody help me? Just added a post to stackoverflow, please check: http://ift.tt/2Cxt7Sx in advance

Submitted February 19, 2018 at 06:14PM by blindado123

Client side Node.js app to download videos from Amazon S3.

Hi there,I'm working on a project that requires me to download a list of videos onto a digital signage client ranging from 5-100mb. Currently I'm working with async promises but my current code has some issues where downloads will timeout silently, presumably because of a slow internet connection trying to download too many large files simultaneously.I'm not looking for code review, more so a high level approach to take.The app should:Be able to download a large list of files from Amazon S3. Signed URL's are already provided.Be able to work with less than ideal client internet connections, within reason of course.Be able to handle errors. This is important as I'm currently having a bit of hell triggering these timeout errors. (which, upon some research, appears to be a node bug)Let me know what you think. If you think there's a more appropriate approach, other than node, I'd also be interested in hearing your thoughts.

Submitted February 19, 2018 at 05:30PM by potato_waave

How to use OAuth with Express in NodeJS

http://ift.tt/2o9F5NU

Submitted February 19, 2018 at 04:17PM by CryptoNotifierDev

I recently started a new side project, a RESTful database powered by Redis and NodeJS. Thought I'd share. Repo is going to be updated in a bit!

http://ift.tt/2sCkCG9

Submitted February 19, 2018 at 02:12PM by OzziePeck

asm-dom-boilerplate: WebAssembly C++ apps without configuration

http://ift.tt/2BDaeRk

Submitted February 19, 2018 at 02:34PM by Teo_Basso

A Playground for Cross Device Live Speech Recognition with node.js, express and socket.io

http://ift.tt/2C5QDu5

Submitted February 19, 2018 at 01:50PM by vinnivinnivinni

Node-FLIF Version 1.0.0 is released - FLIF image compression using Node.js/npm

http://ift.tt/2ohjqm2

Submitted February 19, 2018 at 01:10PM by jaredcheeda

JSNES: A JavaScript NES emulator in NodeJS

http://ift.tt/2Bn4afJ

Submitted February 19, 2018 at 12:39PM by fagnerbrack

How to get the Node.js performance benefits?

Hey everyone,I'm just getting into Node.js. I've read that Node.js took the world by surprise a few years ago, by doing some non-blocking / asynchronous I/O magic, which allows a Node.js-powered server to be able to handle a large number of requests.I've read several articles about this, but I just want to make sure: in order to get the benefits, you actually have to write async code, correct? (using promises or async/await).If your API has to access the DB, you'd have to make sure Node.js isn't holding its breath for the read/write to complete, right?Thanks!

Submitted February 19, 2018 at 09:32AM by tehnologie

Designing a REST API with Node.js and MongoDB Atlas

http://ift.tt/2BCnvpM

Submitted February 19, 2018 at 08:22AM by ms-maria-ma

I ❤ JavaScript: Weird parseInt

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

Submitted February 19, 2018 at 08:28AM by ginger-julia

Help making a simple sports app?

I should start by saying I'm new to Node. I only have experience making static sites so I'm pretty lost here. Basically, I want to make an NBA app similar to http://ballislife.io but much smaller just as a fun project. I want to be able to search a player name and have the player's stats show up. Ballislife.io uses nba.js. I've tried nba.js, but I'm not sure how to handle promises.I'd really appreciate any pointers or useful libraries I should use.

Submitted February 19, 2018 at 08:03AM by IcyHeartWarmSmile

How to check for null variables in the array?

I get user data such as email, password, username, and I need to check null data in params in express.js, I make a simple script for checking for null in the array, but I cant integrate it with expres.jsvar arr = [null, "Lol", "Kek", "Chebyrek"]; // Is in array null varibles? true is yes, false if no :) arr.some( (num)=>{ if ( num==null ) { return true } else { return false } } ) // Its good for express.js api check req.params :3

Submitted February 19, 2018 at 06:07AM by maratmkhitaryan

Sunday 18 February 2018

Great course for learning node.js. Integrating challenges to code on our own, applying the lecture, is a great learning tool. Andrew has a wonderful way of explaining things so that it's easier to understand. This has given me a solid foundation to start my first real app.

http://ift.tt/2EEdKxK

Submitted February 19, 2018 at 05:15AM by angela7walker

Protect your npm account with 2FA and Authy

http://ift.tt/2ECTpJ5

Submitted February 19, 2018 at 03:01AM by gregbaugues

The lack of streaming templates

The mean reason I love node.js is it's async nature. You are forced to write async code all the time, which is huge benefit. I have always used JSON APIs to write my server side code and streamed the JSON result. This time I need to write a HTML API, which may produce thousands of rows with identical markup. There is no option to add pagination. I've checked that only the data I want to process uses 100 MB of node.js RAM (not the data itself), so it's ideal candidate for a stream.I've done my research and found a single template engine, that supports stream parameters - LinkedIn's https://dustjs.com, which haven't been updated since 2016. Am I missing something? Why there aren't more template engines that support stream parameters? Even the python's flask template Jinja2 supports streams. I thought of a workaround - to split my template files to smaller chunks and stream them manually, but it's ugly solution. Any help will be appreciated!

Submitted February 19, 2018 at 12:17AM by suricactus

node + express: Receiving `net::ERR_ABORTED ` only for included .js files

Is API gateway an anti-pattern?

Commonly I see people creating a 'microservice' that serves *all frontend requests, authenticate them and *orchestrates among all the real business microservices. It aims to facilitate the service consumption for the frontend.To my humble opinion, this violates core principles of microservices: 1. Multiple deployments will be required now to deploy a single feature - a change in the real service + a change to the gateway which approaches it 2. The gateway is a single point of failureThe gateway is actually a smart pipe which knows a lot of things about many servicesNote: I'm not referring to networking API gateway, a reverse proxy, which just performs 'dumb' HTTP related tasks

Submitted February 18, 2018 at 05:14PM by yonatannn

My next episode, we are almost done building the API. We finish the Signup APIs and do some house keeping like build flow types, input validations and documentation.

https://youtu.be/r4XDJFkA2rM

Submitted February 18, 2018 at 04:10PM by sheffmaster

Node.js Top 10 Articles (v.Feb 2018)

http://ift.tt/2Gp5Og8

Submitted February 18, 2018 at 04:48PM by Rajnishro

How do I access properties on a class in a view?

I do not know if this approach is wrong, if so please do tell, as I am new to NodeJs. But I am trying to achieve in Handlebars, to access a method. The way I have it structured is like this: I have a Series component which has the following: * Series.js * SeriesController.js * SeriesDAL.js * SeriesService.jsIn the Series.js I have a function to get all series with simple select all, SQL. I then create a new instance of SeriesDAL, and wrap all the results around a SeriesDal class. Inside the SeriesDal, I wrap each result into a SeriesService.Then I have a class of SeriesDal with an array of SeriesServices.Now I have two problemsThe first is my result set looks like this:SeriesDal { series: [ SeriesService { serie: [Object] }, SeriesService { serie: [Object] } ] } Which means in my view I have to do a loop inside of a loop to reach the series.Can I somehow reach something that looks like this:SeriesDal { [ SeriesService { [Object] }, SeriesService { [Object] } ] } So that I only have to loop through it once?The second thing is, now in my view, in my loop I am on the SeriesService entry, and let's say I have a custom getLinkRef How would I access this getLinkRef method/propertyExample of the code I have currently made: http://ift.tt/2EAWzsF in advance hope someone can give me a hand here.

Submitted February 18, 2018 at 03:09PM by cawex

Why I get the error :(?

http://ift.tt/2HsMkZ8

Submitted February 18, 2018 at 02:48PM by maratmkhitaryan

Prefer Firebase over socket.io

Sharing my thoughts on why using in-process/in-service websockets (socket.io style) is an anti-pattern and why some external middleware should be preferable. Having few microservices which are split among few processes (e.g. containers) means that various processes are holding sockets with clients, should one process is brought down (scale-out, in, upgrade version) we lose all its connections. Other than that, it becomes odd how various microservices are sharing the connections: per service TCP connection is too eager, sharing connection among microservices creates tight-coupling (e.g. the user service might get event of the order service). Sockets are just a stateful concept that we force into a stateless domain.The proposed solution: you wouldn't make your microservices API host a push notification service or SMS server, right? you treat those as external networking service. For that reason, it should be kept outside on a global stateful servers that do nothing but websockets communications. Every service that wishes to push to the client will call the websockets server.Firebase provide that functionality out of the box. Alternatively, you can host your own socket.io external service, on a separate serverWhat do you think?

Submitted February 18, 2018 at 10:56AM by yonatannn

Build a Todo App with Node.Js, ExpressJs, MongoDB and VueJs - Part 1

http://ift.tt/2H15o0s

Submitted February 18, 2018 at 07:59AM by dobkin-1970

Saturday 17 February 2018

Are there any laravel-like frameworks that use the latest JS syntax (eg. imports, es6/7, etc.)?

I'm looking for a pleasant way to do a full-stack project in my free-time using all JS. I came across AdonisJS which seems to almost fit the bill but it's annoying how the custom "use" system with a container breaks VS Code's intellisense. Loopback v4 looks promising but still far away from official release and v3 uses old module.exports and vars.

Submitted February 18, 2018 at 12:54AM by MagicalMysteryTor

Better way to validate inputs?

One of my PUT functions is like 100 lines of just validating inputs (name, email, etc.) I feel like there should be a better way to do this. I started using Validator and that has helped but it's still a pain to create any form and validate it.Does anyone have a better way to do this?

Submitted February 17, 2018 at 10:14PM by allvoid

GraphQL as an API Gateway to Microservices

http://ift.tt/2EazxbV

Submitted February 17, 2018 at 06:31PM by ms-maria-ma

Free Video Tutorial: Firebase Cloud Storage With Angular

http://ift.tt/2EPu3qw

Submitted February 17, 2018 at 05:18PM by codingthesmartway

3 simple tricks for smaller Docker images

http://ift.tt/2GntWji

Submitted February 17, 2018 at 04:13PM by danielepolencic

Any recommendations on how I could improve the documentation on this project. The architecture of this project isn't conventional and relies on hooks. Currently it's in process of refactoring which would reflect the skills I have developed in the past few years.

http://docs.clout.tech/

Submitted February 17, 2018 at 03:00PM by dadum01

How does Indeed.com's bots work? And can I build one with NODE?

I hear that Indeed crawls the internet for jobs and posts them on their website. How do they do it? And can it be done for Node?

Submitted February 17, 2018 at 02:03PM by ineedhelpcoding

Setting up node.js without an installer/Help with setting up paths

I'm trying to set up node.js without an installer (as I have no admin permissions on my computer - don't ask why) and when I try to run certain commands such as "npm init" it does nothing.I've figured out this is due to the paths not being configured correctly. I am trying to figure out what paths need to be set up and how to do it without stepping on the admin perms landmine. Can anyone help me out?

Submitted February 17, 2018 at 06:06AM by CircleSongIsDank

sloww - the Slowloris attack CLI built in Node

http://ift.tt/2EwBNdG

Submitted February 17, 2018 at 06:58AM by Etha_n

Friday 16 February 2018

Quick CVE-2018-3721 (__proto__ from JSON.parse) mitigation

Guys, need quick brainstorm for mitigation of http://ift.tt/2F80cHR It has already leaked in other subreddit. So, I am not exposing anything.Looks like Object.freeze( Object.prototype ); is a quick and permanent solution.Modification of global prototype is definitely a bad practice. So, such pattern should be removed in modern applications. Also, it's possible to call the statement after global prototype modification is complete.Example below.const _ = require( 'lodash' ); console.log( ({}).test1 ); // undefined _.merge( {}, JSON.parse( '{"__proto__": { "test1": "123" } }' ) ); console.log( ({}).test1 ); // "123" Object.freeze( Object.prototype ); console.log( ({}).test2 ); // undefined _.merge( {}, JSON.parse( '{"__proto__": { "test2": "123" } }' ) ); console.log( ({}).test2 ); // undefined Any drawbacks you can think of?

Submitted February 17, 2018 at 12:08AM by andvgal

A Node.js Perspective on MongoDB 3.6: $lookup and $expr

http://ift.tt/2F88Ohq

Submitted February 16, 2018 at 11:06PM by code_barbarian

Run commands on multiple node versions from .travis.yml, circle.yml or arguments; uses npx and is ideal for testing.

http://ift.tt/2F9kYH0

Submitted February 16, 2018 at 09:44PM by delegoat

Billing/Abonnement System

Hey guys! I just wanted to ask what you guys thing would be the best practice for implementing a payment system to you NodeJS Application. Let's say you have some predefined Packages but want the user to also have the ability to add custom amounts to their package... Is there any pre-written system you would recommend? Or should i implement it myself...Thanks a lot!

Submitted February 16, 2018 at 09:56PM by avejack

socketbox is minimal socket framework inpired by express. (Beta)

http://ift.tt/2EAYnpB

Submitted February 16, 2018 at 08:48PM by _dmomer

What programs come with node.exe?

Besides Node.js itself, of course, I just found out that Photoshop CC 2017 comes with node.exe v4.3.1.

Submitted February 16, 2018 at 08:04PM by Skhmt

Node.Js Development Company

http://ift.tt/2AgNVxv

Submitted February 16, 2018 at 06:14PM by anikasharma892

How to sort posts by upvotes AND time in MongoDB?

So I have a collection of posts where two fields are: upvotes and a timestamp.I'm trying to add another field called "points" for each post which aggregates the upvotes and timestamp.i.e. This would allow me to $sort the posts and have the ones with the highest points rise to the top.For example: if something is posted < 10 minutes ago: 10 points, < 1 hour ago: 6 points, < 4 hours ago: 4 points, 24 hours ago: 0 points. Then 1 upvote is also worth 1 point. two upvotes 2 points etc...Something posted 4 hours ago (4points) with 3 upvotes (3points) would have 7 pointsSomething posted 1 hour ago(6points) with 2 upvotes(2points) would have 8 pointsAny help much appreciated?

Submitted February 16, 2018 at 04:50PM by harrydry

Best implementation practices when using Napa.js on an express based application?

I've been doing to research into implementing Napa.js for some API's I'm working on, but I can't figure out how or if I even should zone my I/O or just leave it on the main thread. In napa's introduction documents it states using a "virtual node" worker for I/O, but I can't find any examples of it actually being implemented, or if this is just referring to the piping and marshelling of data between the workers within the zone.I'm curious if anyone else has had a similar experience using it. If I had my choice I would just implement a more concurrent language like Go to do this, but that's currently off the table due to other concerns.

Submitted February 16, 2018 at 03:51PM by TheOfficialGent

Weekly Node.js Update - #7 - 02.16, 2018

http://ift.tt/2C3FIRF

Submitted February 16, 2018 at 01:33PM by andreapapp

💚 3 Valentine’s Poems for a Beloved & Secure Node.js App

http://ift.tt/2sAnIdH

Submitted February 16, 2018 at 02:18PM by labelolo

NODE.JS VS. ANGULAR.JS – TWO SIDES OF THE SAME COIN

http://ift.tt/2CoRMsn

Submitted February 16, 2018 at 11:17AM by Slavos17

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

http://ift.tt/2n6qEMF

Submitted February 16, 2018 at 10:07AM by AlfredEkka

Introducing Node Clinic - A performance toolkit for Node.js developers

http://ift.tt/2rQHuRO

Submitted February 16, 2018 at 10:46AM by fagnerbrack

Thursday 15 February 2018

Tutorials/Material recommendations for learning MERN Stack?

Hey Guys,i'm coming from a RoR background and want to switch to a node stack, which i have chosen the MERN stack for. So i'm interested in your opinions on good tutorials and ressources for learning the MERN stack. Already found some stuff through a quick google search, but i'd rather stick to what you recommend based on your experience. Already have a little experience in Javascript development, but good ressources for enhancing my native Javascript skills would also be great.

Submitted February 15, 2018 at 09:30PM by kifkev91

Creating Custom Components with Nextein

http://ift.tt/2C3ArcI

Submitted February 15, 2018 at 09:45PM by elmasse

Looking For Suggestions - RoR Background

I want to build essentially a to-do list app in Vue (with Postgres), but I feel Ruby on Rails is overkill for that type of project. I've done some research, and it seems things are quite open-ended in the world of Node.How would you go about building such an app? Should I give Koa + Knex a whirl? Just want to make sure I'm heading in the right direction here.

Submitted February 15, 2018 at 07:55PM by to-too-two

I currently have a Wordpress website, should I migrate the content to node?

I've hired a developer and he explained that it is not wise to migrate Wordpress because it could hurt SEO.Background information: Currently using a MEAN stack Goal is to increase page speed, search engine referrals, and traffic Integrate the blog with other features in the application such as comments, user profiles, etc.What are your thoughts on migrating from Wordpress to node?

Submitted February 15, 2018 at 06:18PM by ineedhelpcoding

20 Node security best practices (draft)

Hei, our repo of Node best practices (55 items currently) is about to add soon a security section. Currently, we have ~20 items but we seek for more, mostly those that are highly related to Node. Would you like to suggest here or at the repo?http://ift.tt/2EtLLki

Submitted February 15, 2018 at 04:58PM by yonatannn

How to run a maximum number of Promises in parallel?

If I retrieve 100 rows from the database, and want to do some async function on all of them, how can I do it and set a maximum? So instead of doing all 100 at the same time, I could specify that I want to do 10 at the same time.How could I pass an array of those 100 Promises and specify that it should do a maximum of 10, so when the first Promise finishes and 9 are in progress, it will get the next one from that array. And if any of the Promises rejects, then the whole thing will stop.Is it a straightforward enough thing that I could program on my own, or would I need some kind of library for this? I'd like to know how to do it on my own for learning purposes, but if it's terribly complex then I guess if you could recommend some libraries for this that would be good too.

Submitted February 15, 2018 at 02:54PM by nowboarding

Writing Node.js questions

TestDome.com provides work-sample testing for companies interested in using measures of performance on actual work as part of their hiring process. We are planning to expand our tests to Node.js and are looking for several Node.js experts with hiring experience to help us decide which topics are relevant and to write questions. If you are interested in helping us with this, just send me an email to davor@testdome.com and write a one-liner about your credentials as Node.js expert.

Submitted February 15, 2018 at 10:34AM by DavorCu

Tip: JavaScript's Array.from() accepts a second argument that's a `map` function.

https://mobile.twitter.com/addyosmani/status/954254600193769473

Submitted February 15, 2018 at 10:49AM by fagnerbrack

Node.js shared hosting

Has anyone used any Node shared hosting? I am just looking for something cheap and cheerful (akin to the many PHP shared hosting services out there).I am wondering how it works in terms of installing NPM packages, etc...? I am not needing to do anything particularly fancy (simple website, with an API) but want to avoid setting up Nginx etc... on something like AWS or DO if i can help it!Thanksedit: something like this: http://ift.tt/2EvKo4A

Submitted February 15, 2018 at 09:29AM by mattcollins84

How do I write functions in ejs?

hey,I have my project working with express. My route is set to: router.get('/', function(req, res, next) { res.render('index', { title: 'Test', test: test }); });Test are some data from my db. Now I want to add: <% test.forEach((test) => { %> How do I write the function showContent, so that it works? If I use and so on it will throw an error. I tried to import another EJS file where the function was written with no success. Neither did another JS file work.Can you help me?

Submitted February 15, 2018 at 09:35AM by oppoi <% }); %><% function showContent() { %>
<%= test.id %> <%= test.name %>

Wednesday 14 February 2018

Node.js module node-oracledb 2.1 is now available from npm

http://ift.tt/2C0hGao

Submitted February 15, 2018 at 12:14AM by cjbj

My favorite ORM for node, Objection.js, hit 1.0 today!

http://ift.tt/2nZm2Wj

Submitted February 14, 2018 at 08:37PM by brokentyro

Need help making a StompJs Wrapper

Im trying to create a class to communicate with stomp via node. Im using the stompit library.Basically what i want to do is have code like the following.var client = new AMQClient(host,port); client.sendMessage(destination,"Hello"); The problem here is that when doing a stompit.connect it doesnt just return the client. It goes to a callback which in there returns the client. Im new to nodeJs so Im trying to set this up properly. Ive looked up async/await and generators but i cant think how to make them workfunction connectCB(error, client, reconnect) { if (error) { console.log("Connect error:", error.message) return; } else { this.client = client; this.connected = true; console.log(`Connected to: ${this.host}:${this.port}`); } this.client.on("error", (error) => { this.connected = false; console.log(error) console.log("Trying to reconnect....") reconnect(); }) } class AMQClient { constructor(host, port) { this.host = host; this.port = port; this.connectionOptions = { host, port } this.reconnectOptions = { maxReconnects: 10 }; this.connected = false; this.manager = new stomp.ConnectFailover([this.connectionOptions], this.reconnectOptions); this.connect() } connect() { console.log(`Connecting to: ${this.host}:${this.port}`); this.manager.connect(connectCB.bind(this)) // stomp.connect(this.connectionOptions, connectCB.bind(this)); deasync.loopWhile(this.isNotConnected.bind(this)); //Syncronize the connection } sendMessage(destination, message) { if (this.connected) { var frame = this.client.send({ destination }); frame.write(message); frame.end(); } else { console.log("Error sending message:No connection to AMQ") } } subscribe(destination, callback) { this.client.subscribe(destination, callback) } getMessageBody(message) { var result = null; console.log("Before reading", result) message.readString('utf-8', function(error, body) { console.log("In reading", result) if (error) { console.log('read message error ' + error.message); return; } result = body; }); console.log("before desync", result) deasync.loopWhile(function() { result != null }); console.log("After desync", result) return result; } isConnected() { return this.connected; } isNotConnected() { return !this.connected; } } I got something like that working so far but im not sure its the best way of doing things. I tried to make the connect function an Async function then doing an await on it but then when i run client.sendMessage it gives the error that its not connected. Any suggestions would be appreciated.

Submitted February 14, 2018 at 08:48PM by ponzi314

In-memory file system

http://ift.tt/2uXhBRL

Submitted February 14, 2018 at 06:54PM by libreact

Reducing GraphQL response size by… a lot

http://ift.tt/2EqLhae

Submitted February 14, 2018 at 05:34PM by gajus0

Working JSON RPC2 module?

I'm looking for a working JSON RPC2 package that works over sockets (not just express middleware that requires you to POST data).I've tried out all the top hits on google search, but they are either woefully out of date (5-6 years), or just plain don't work.Has anyone actually used a JSON RPC package that works? If so, please share!

Submitted February 14, 2018 at 03:21PM by 4_teh_lulz

Handling Postgres migrations in production?

I was hoping someone running a Node API in production (extra points if you are using Heroku, but it's not that specific a question) can outline the steps they are taking for migrating schema and table data?There are a two notable solutions I have found:http://ift.tt/2BYVfSM it's hard to determine which suits me with no prior knowledge. I need to be able to update my table schema that will be hosted on Heroku Postgres.I am using node-pg to connect to the database and issue queries, so I cannot use Sequelize/Knex's built in migration tools.Any insight, articles or descriptions of your process would be greatly appreciated.

Submitted February 14, 2018 at 02:19PM by speakoN

Finally a better alternative to dotenv

http://ift.tt/21lUAOz

Submitted February 14, 2018 at 01:52PM by Capaj

Event sourcing vs CRUD

http://ift.tt/2EDS6IX

Submitted February 14, 2018 at 11:42AM by andreapapp

Building a Full-Text Search App Using Docker and Elasticsearch

http://ift.tt/2Eb4jlV

Submitted February 14, 2018 at 09:47AM by ginger-julia

Tuesday 13 February 2018

Does node keep internal reference of all TCP client sockets?

I am wondering if when I call client = net.connect node keep an array of all sockets created with this method.If in one function I 1. create socket 2. send message/recv resp. 3. socket.end, and then the function disappear from stack, if any other references to client remain internally in node

Submitted February 14, 2018 at 12:19AM by MyyHealthyRewards

Node v6.13.0 (LTS)

http://ift.tt/2o7Va66

Submitted February 13, 2018 at 08:47PM by dwaxe

How to prevent your Node.js process from crashing

http://ift.tt/2siNRO1

Submitted February 13, 2018 at 06:08PM by Fuzz_Stati0n

Deploying node apps to windows servers(X-Post/learnprogramming)

http://ift.tt/2nWuh5z

Submitted February 13, 2018 at 04:38PM by cjrutherford

The Most Important NPM Package 2018 is Here

https://twitter.com/GantLaborde/status/963442667383386113

Submitted February 13, 2018 at 04:01PM by GantMan

GraphQL-to-MongoDB, or how I learned to stop worrying and love generated query APIs

http://ift.tt/2BY0Qc8

Submitted February 13, 2018 at 03:40PM by Yoav-Karako

node-report: Delivers a human-readable diagnostic summary, written to file

http://ift.tt/2m98ZC8

Submitted February 13, 2018 at 03:33PM by micro_apple

how to deploy react app with keystone js on linux server

hello , now i am create a react js app [frontend] and keystone js app [backend] how can i deploy two apps to linux server and make keystone js listen to requests from react app ?

Submitted February 13, 2018 at 02:36PM by a7me6_azza8

5 Tips and Thoughts on Async / Await Functions

http://ift.tt/2DnoHie

Submitted February 13, 2018 at 12:16PM by fagnerbrack

Top 1000 most depended-upon packages

http://ift.tt/1UbIGoX

Submitted February 13, 2018 at 01:30PM by ratancs

Simulating Chaos (no monkeys here)

As part of checking our production readiness, I'd like to simulate bad scenario and ensure that our code and ops react well in return. For example, container/pod died? API keep responding correctly, API returns an error? we see that in logs, uncaught exception? we get severe notification via slack, etc, etcWhich tools would you use to simulate that chaos?

Submitted February 13, 2018 at 09:14AM by yonatannn

Monday 12 February 2018

How do you really implement async-methods in express routes?

Hi,Im making a move from .NET/C# to the wonderful world of open source. Im making a small rest api in nodejs with postgres as the database, but I cant seem to figure out how to implement the async-methods in my express-routes. Whatever I do, they never "fulfill" and are always undefined. I have implemented according to the best practice on the ps-homepage, but I cant seem to wrap my head around how you await for a async-method to finish?Example:router.get('/', auth, async (req, res) => { var text = 'SELECT * FROM public.sale WHERE product.companyID = $1' const { rows } = await db.query(text, [1]) res.send(rows[0]) }) How do I await a call like this, and how do you "catch" errors that come out of it?Thanks for all help on this as the whole async-thinking is somehow missing from me.I've been using the projects guide to setup according to this: http://ift.tt/2o0T1c1

Submitted February 12, 2018 at 08:18PM by smallpom

Anyone using AdonisJS in production?

http://ift.tt/2CeJbZs looks pretty nice. Claims to be like Laravel (I've never used Laravel, so wouldn't know). Anyone use this is production? If so, any thoughts, takeaways or opinions on it?

Submitted February 12, 2018 at 07:30PM by general_salt

Are there any worthwhile node certifications out there?

I go on a bit, tldr at the bottom.I'm planning on finding a new job this summer after being a .net developer for about 3 years.I found the "NCD" but looking at the github page they're a few months behind on their plan of public release in March and I'm planning on applying when my apprenticeship comes to an end in summer. I've done a couple of training courses on udemy and started building side projects that I never bothered to follow through on. I was fairly confident in my ability until I saw the topics the exam covers on the github page. It's possible I've covered some of these topics without knowing it but I don't have a clue what things like "Child Processes (Basics, no IPC/fork)" are.Is there a node exam out there and training course to go along with it that I could use to gauge my ability (or lack of...)?tl;dr I found the "Node Certified Developer" exam offered by the node foundation but it doesn't look like I'll be able to do it any time soon. Is there another exam/course to follow to gauge my ability and demonstrate it to a potential employer?

Submitted February 12, 2018 at 06:37PM by tomzus

Hackernoon: 5 Practical Ways To Share Code From NPM to Lerna And Bit

http://ift.tt/2Bpk1dO

Submitted February 12, 2018 at 05:04PM by JoniSar

AmsterdamJS Conf is looking for Node talks! Submit one before Feb 28

https://amsterdamjs.com

Submitted February 12, 2018 at 04:18PM by FrontendNation

Some noob doubts about Objection.js json schema.

When is the JSON schema used?Is it used to validate the JSON that's provided while inserting or patching? Or is it used to validate the JSON form of the Model object itself?If its the latter case, do I need to mention the createdAt and updatedAt properties which are set automatically using $beforeInsert and $beforeUpdate hooks?

Submitted February 12, 2018 at 12:34PM by sioa

Receive and send mjpg stream

I am doing an application which connects to a server, stores a continuous stream of data (mjpg images) and when a client connects to a url (/stream) it sends the frames to the client. I havent figured out yet the exact implementation. For now I am thinking to create an array of buffers (30-50) each will store one frame (images are small). I think this is a good idea because this way I have always a few frames stored to stream.My main question is can an array be accessed in two places at the same time?Am asking this because when the node server starts it connect to the streaming server and on data event I would like to write the data to the buffer array, but at the same time I would need to read from the same array to stream a frame (not the same index as the writing frame) to the clinet. I dont yet fully understand the node execution cycle and would really like to know if this is possible.

Submitted February 12, 2018 at 10:20AM by jurgonaut

Continuation Local Storage middleware for easier storage access inside function calls

http://ift.tt/2CesX2n

Submitted February 12, 2018 at 10:38AM by blacksonic86

Just started making a pet project using ExpressJS, great occasion to write about it %) Tutorial "JS on Backend in 2018". Part 1. Application server, getting started with ExpressJS

http://ift.tt/2G3Oflq

Submitted February 12, 2018 at 08:42AM by graffzon

Sunday 11 February 2018

Heyyy Guys!

Hey everyone ! Just wanted to say that I’m currently looking for a co-founder on a new project I’m hoping to start. I don’t want to spam here , but I figured this is a great community of people to ask. (Please, feel free to delete this post if it doesn’t belong here!) If not you, then maybe you have someone in mind that could be a good fit. Desired qualities: - Experience with crypto/stock trading algorithms - Experience with neural networks / deep learning / AI - Self-motivated with enough time to take on a new project - Enthusiastic about the future blockchain/cryptocurrencies - Understanding of smart-contracts and their functionality - Desire to make the world a better place - Desire to help people answer the question, “What if money was no option?”

Submitted February 11, 2018 at 08:33PM by arnoldmuimi

[Socket.IO, Express] Should app logic be in socket handlers or REST api?

Disclaimer: this is was posted on stackoverflow a few days ago. I received no answers so far probably because my question is a bit specific.I'm planning a non-trivial realtime chat platform. The app has several types of resources: Users, Groups, Channels, Messages. There are roughly 20 types of realtime events having to do with these resources: for instance, submitting a message, a user connecting or disconnecting, a user joining a group, a moderator kicking a user from a group, etc...Overall, I see two paths to organizing all this complexity.The first is to build a REST API to manage the resources. For instance, to send a message, POST to /api/v1/messages. Or, to kick a user from a group, POST to /api/v1/group/:group_id/kick/. Then, from within the Express route handler, call io.emit (made accessible through res.locals) with the updated data to notify all related clients. In this case, clients talk to the server through HTTP and the server notifies clients through socket.io.The other option is to not have a rest API at all, and handle all events through socket.IO. For instance, to send a message, emit a SEND_MESSAGE event. Or, to kick a user, emit a KICK_USER event. Then, from within the socket.io event handler, call io.emit with the updated data to notify all clients.Yet another option is to have certain actions handled by a REST API, others by socket.IO. For instance, to get all messages, GET api/v1/channel/:id/messages. But to post a message, emit SEND_MESSAGE to the socket.Which is the most suitable option? How do I determine which actions need to be sent through an API, and which need to be sent through socket.io? Is it better not to have a REST API for this type of application?

Submitted February 11, 2018 at 03:43PM by Tioo

NPM style code formater

So I have this codebase that is written in the coding-style of npm. It has been decided that this is the coding-style that will be used. There is nothing I can change about that. I'm not saying that it's a good or a bad style. It's just a fact that this coding-style will be used. If you don't know the coding-style of npm they format things like this:var magicWords = [ 'abracadabra' , 'gesundheit' , 'ventrilo' ] , spells = { 'fireball' : function () { setOnFire() } , 'water' : function () { putOut() } } , a = 1 , b = 'abc' , etc , somethingElse Is there a code formater that can format code like this? js-beautify supports comma_first but there is no support for the "funny" (as npm call it themselves) indentation style.(I don't want this to turn into a discussion about code-style, please. )

Submitted February 11, 2018 at 03:14PM by ThereIsNoDana-6

Using Greek characters as variable names?

I reviewed some code recently that used the Greek lambda character in variable/function names. The usage of it made sense in context. I started thinking about the possibility of using other Greek characters sensibly in variable/function names (delta, for example). But I haven't done it yet. Is it reasonable?

Submitted February 11, 2018 at 11:22AM by calligraphic-io

String Decoding - Issue with UTF8 Characters

I've decided to move my project to Node.js, however I encountered a problem right at the beginning. Unfortunately, some unicode characters which my alphabet has does not appear correctly when I decode strings which I get via net module's sockets. I've researched and ended up using iconv-lite module, which solved my issue, now I can encode and decode strings just fine. However, when compared with buff.toString(), decoder.write(buff) seems approximately 3 times slower in my use cases. What would you recommend to make it work faster? Should I write my own decoder, presumably with c++ to make it faster? Do you think would it help to have a proxy between client and my program to do the decoding and hand correct output to node.js? (that probably makes less sense compared to a c++ add-on) I think I've read in the documentation that it is possible to build node.js with different language options. Should I choose that route?Thank you

Submitted February 11, 2018 at 06:48AM by safeTell

Saturday 10 February 2018

An Argument For Why Nested Ternaries are Great

http://ift.tt/2DB0bOV

Submitted February 11, 2018 at 02:32AM by fagnerbrack

Someone interested on natural language analyzers?

http://ift.tt/2Eh60kR

Submitted February 10, 2018 at 08:46PM by jesusgn90

Update a table populated with JSON data with a button click?

So I have a table of definitions that I want to be able to filter by category of the word. So when a user pressed a button it will sort by whichever category they pressed. How would I go about doing this, as I can only find examples that use forms, but mine isn't a form. I believe I will need to have a get request on the button that requests all the data with a certain category, however, I don't know how to do this.The JSON data{ "definitions":[ { "Category":"Algorithms", "Word":"Algorithm", "Meaning":"A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer." },{ "Category":"Algorithms", "Word":"Binary Search", "Meaning":"Search a sorted array by repeatedly dividing the search interval in half. " },{ "Category":"Algorithms", "Word":"Linear Search", "Meaning":"Linear search, also known as sequential search, is a process that checks every element in the list sequentially until the desired element is found." },{ "Category":"Exchanging Data", "Word":"HTML", "Meaning":"Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages." },{ "Category":"Exchanging Data", "Word":"TCP IP", "Meaning":"A set of network protocol layers that work together" },{ "Category":"Software Development", "Word":"Agile software development", "Meaning":"Agile software development is a group of software development methods in which requirements and solutions evolve through collaboration between self-organizing, cross-functional teams." } ] } How I am currently sending the dataapp.get('/definitions', function (req, res) { var contents = fs.readFileSync("defs.json"); var jsonContent = JSON.parse(contents); res.render('definitions', {title: "Title", defs: jsonContent.definitions}) }) And here's how I am populating the table using PUG (Formerly Jade).container.defs-body table.table.defs-table.table-hover thead.thead tr th Category th Word th Meaning tbody.defs-table-body each definition in defs tr td= definition.Category td= definition.Word td= definition.Meaning Thanks.

Submitted February 10, 2018 at 08:52PM by mexO2000

Getting really confused about what should be async, Promise

So, I am writing a REST API with node.js. It's been fun so far but I am getting really really confused (and a little bit annoyed). I have this code: linkI created a route /user/register with express and its only task is to call an async function. The function queries and inserts into a database (mysql2/promise). I am using await and everything is working as expected.At the end of the function I am calling userToEvents function that is eventually going to have to return some kind of information. It has to be separate because I am going to have to use the same code elsewhere later.The last bit of code should iterate through an array of ids and checks if it is already in the table (it is a join table). And this is the point where I gave up.I tried annotating async the userToEvents method and use await like I do in registerUser function but it didn't work (I guess because the await was inside the Promise). I would like this function to be asynchronous like the rest of the code, but I don't know what to do. I guess it should return a Promise and I should await for it in registerUser. If I am right, what kind of code should be inside the Promise? Can it be synchronous code since it's in a promise that is already asynchronous?

Submitted February 10, 2018 at 07:29PM by ftibi93

Asking about Microservices

Guys i'm a student and i will work part time starting next week. The job is to make microservices of IoT, using NodeJS mongoDB and docker.So i am looking for tutorials and only found this one which i think pretty complete and clearThe thing is, when i looked into it, the code style seems weird. I've made many projects using NodeJS before but that code style still confuses me. Is that how u guys code ?For example, excessive use of using Promise, also what the heck eventemitter isPlease take a brief look. I just want to know If that guy's code is good.I'm afraid that i'll follow a bad tutorial.If he's right then i'll learn his code and follow him.thanks in advance

Submitted February 10, 2018 at 05:51PM by StupidRandomGuy

Help with callbacks

Hi everyone, I need some help with some callback stuff. I sort of get callbacks, but they still confuse me sometimes. Here's what I'm trying to do (it's for an assignment and has to be done this way):You have multiple functions that have a callback. You want to create another function that also has a callback that takes the results from the group of functions and logs in to the console. It looks something like this:var function1 = function(cb) { cb('done 1'); } var function2 = function(cb) { cb('done 2'); } var callback = function(text) { console.log(text) } var function_final = function(function_list, callback) { // fill this in } How can I get the results from the first functions and apply a callback on the final function that outputs these results?

Submitted February 10, 2018 at 04:54PM by PCUK

JWT flow question

Hello guys, I cannot get it exactly how the things are going on with JWT.So, for example, user is registering his account, he enter username and password and on the backend we handle him token as a response. Before we send this response, we SIGN a token with SECRET and we send the data we wanted inside that token.But the problem is that anyone can copy the token and go to the JWT website, paste it and see what's inside (why have we signed it?!). OK, i know we should not store sensitive data inside a token, but how do SERVER know that toke which is being sent from the client is not stolen? How does that verification process going on on the server? I know there is VERIFY function of the JWT with that secret again, but what if the token is stolen? I am not sending anything from the client beside a token which can be decoded by anyone.So I am concerned about how the server knows if the right user is sending a JWT? Thanks. :)

Submitted February 10, 2018 at 04:15PM by nikola1970

My first video where I explain the difference between returning with await and not in an async fn

https://youtu.be/4tfvLvLi2gI

Submitted February 10, 2018 at 03:47PM by richie_south

How to save exact npm package versions

http://ift.tt/2H5lhDe

Submitted February 10, 2018 at 11:56AM by dalejefferson

Node and Ajax doubts

Hi, so i recently started making my own webserver with express, and it's nice for handling everything without having to use the standard api, but i came across a problem:mammaMI.use(xpress.static("./")); mammaMI.get("/postcontent", function(req, res){ console.log("logged"); }) mammaMI.listen(80); I tried sending a post request to /postcontent, but it doesn't get it! Here is my JavaScript(i used alert("") to check if it executed, and it did):function postContent(){ alert("hei"); var conn = new XMLHttpRequest(); alert("2"); conn.open("POST", "/postcontent", true); alert("3"); conn.send("hihi"); alert("4"); };

Submitted February 10, 2018 at 12:21PM by AnonymousAlien11

Testing my Node.js Chatbot, here is what we learned

http://ift.tt/2EtgOvL

Submitted February 10, 2018 at 11:15AM by cat_dog_pork

What resources did you study professional node development?

Share only proven resources that you personally used.

Submitted February 10, 2018 at 11:15AM by alerrce

How do you debug?

I'm new to node.js, so which debugging tools would you recommend? So far I've tried vscode and chrome devtools. Any useful tools for multi-process node debugging?

Submitted February 10, 2018 at 07:14AM by goatdecimal

Friday 9 February 2018

Best method to read tag values from html file

I'm trying to make a simple comparison program. I want to read in two .html files, read the values of their tags and compare them. Anyone have some guidance? Is there a module I should consider using? Thanks! Huck

Submitted February 10, 2018 at 02:56AM by HuckleberryC

New to Node, a little help?

Hi, I'm working on a question for a course I'm taking in Node.js and I'm stuck. I don't really want to post the question, but it involves callbacks and really making sure you understand them. Is there someone who could PM me to offer a little assistance?

Submitted February 10, 2018 at 12:06AM by PCUK

A Node.js Perspective on MongoDB 3.6: Change Streams

http://ift.tt/2EfzkZ5

Submitted February 09, 2018 at 10:42PM by code_barbarian

Nodejs Book.

Hey guys, I've started working with NodeJS a few months ago doing some basic CRUD tasks and building a user login. I really liked working with NodeJS and express and I wanna progress my skills further.Can you recommend a good general NodeJS book? I'm struggling to find some more recent editions from 2017.

Submitted February 09, 2018 at 07:44PM by MrGoodnight1101

Show r/node: All Tests Pass, a weekly JS debugging puzzle newsletter

http://ift.tt/2BjRS7L

Submitted February 09, 2018 at 08:10PM by fillerwriter

Local MySQL strategy for passport.js?

I am currently working my way through The Web Developer Bootcamp and the emphasis has been on NoSQL so far.However, I would really like to tinker with MySQL and other relational databases.I know that passport-local-mongoose exists for MongoDB, which is quite easy to implement.Does anybody know where I can find something like passport-local-mongoose but for MySQL?

Submitted February 09, 2018 at 06:56PM by InterdepartmentalNun

SyntaxError from Paragraph Separator Unicode Character

When I try to use unicode character u+2029 in a single quoted string I get a SyntaxError. Is this expected? If not, is the bug in V8's parser?Any thoughts or ideas very appreciated!Test Case:xxd syntax-error2.js 00000000: 413d 27e2 80a9 273b 0a A='...';. Output:$ node syntax-error2.js syntax-error2.js:1 (function (exports, require, module, __filename, __dirname) { A='​ ^^ SyntaxError: Invalid or unexpected token at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:599:28) ...

Submitted February 09, 2018 at 05:36PM by Fuzz_Stati0n

Recommended way of handling authentication

What is the recommended way of achieving authentication in Node? By authentication, I mean user sign up, sign in, sign out, password reset emails. There are a bunch of articles on Passport but they only touch on sign in / sign out as if that were it. Is Auth0 the way to go? Are most using sessions, or JWT? I'm coming from a background in Rails so something like Devise took care of all this.

Submitted February 09, 2018 at 05:17PM by general_salt

Weekly Node.js Update - #6 - 02.09, 2018

http://ift.tt/2C8l8ez

Submitted February 09, 2018 at 04:28PM by andreapapp

objection.js - relationships

Hi folks, i'm having hard times understanding how I should model many-to-many relationships in objections.js.The documentation on relations is not clear to me.Basically I have an app with an Account, Post and Like tables. A account can have posts and people can like it.Tables are like this:Account tableKeyFieldPKidusernamepasswordPost tableKeyFieldPKidFKaccount_idcontentLike tableKeyFieldPKidFKaccount_idFKnickname_idI have modeled the relationship between Account and posts using HasManyRelation on the Account model and a BelongsToOneRelation on the Post model.Now I can't figure out how to model the relationship between the Account and the Post through the Like table.Any help is appreciated

Submitted February 09, 2018 at 03:12PM by honestserpent

New to node, how do?

"Unknown option: \t" printing in terminal - nvm

So I recently installed nvm and it works nicely, but every time I launch a new terminal (st) or run an nvm command it prints Unknown option: \t twice in the terminal.if I comment out: [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm in my ~/.bashrc it goes away, but of course then I can't use nvm or node.any suggestions on how I might be able to fix this? Its pretty annoying! lol.thanks.

Submitted February 09, 2018 at 02:16PM by black_daveth

Hi, i'm kinda new to node, and would like some insights

Ok, so i have a few questions, and this, seems the right place to do so:1)Let's say i have a structure like this:| --\libs ----\firstlib ------\node_modules ----\secondlib ------\node_modules myfile.js What would be the best way to load my modules? I've tried withrequire("./firstlib/node_modules/mymodule") require("./secondlib/node_modules/othermodule") which is ok, but i would like that, in myfile.js i could just do require("thelibineed"), and in package.json you can set only a {main: "***"} entrypoint. So, i would have to make just a libs.js file with require()?2)What's the best way to make classes and export them? Coming from a C++ background, i like to keep my code organized, but in node it becomes easily messy, knowing that it's not compiled, optimizing it seems tedious. Suppose i have to make a class module.exports = class aClass{ } How would i go about loading it? Because: const loadClass = require("./classes"); var niceClass = new loadClass(); Seems like wasting memory, with multiple requires i would have to make a lot of variables!3)What about deployment?I couldn't find a right place to seek, but i develop on Windows and deploy on Linux, so how would i go about importing my project? Do i need to place a package.json and just do npm install? I have 2 third-party modules that i need, is the package.json created in the directory automatically updated?

Submitted February 09, 2018 at 12:51PM by AnonymousAlien11

NodeJS and C++

Hi all I'm in project of migrating a legacy C project and i was thinking in use Node.JS + Emscripten SDK in order to expose C function to node and node expose it as respful services. Any thought on that, recommendation tips ? regards

Submitted February 09, 2018 at 10:14AM by juglarx

Can you recommend a few useful node newsletters?

I'm looking to subscribe to newsletters that have interesting content. So far, Google has pointed me towards: SuperheroJS, AwesomeJS, FiveJS, and JavaScript Weekly.Are there any others I should be subscribing to?

Submitted February 09, 2018 at 08:49AM by thattendguy

Package to compile async/await and other NodeJS v7+ features to Lambda compatible v6.10

http://ift.tt/2H1B6L1

Submitted February 09, 2018 at 08:06AM by coder00000001

Thursday 8 February 2018

Need some Help

Hello there, Im really having hard time in starting off my node js website project. I dont know where to start. I learnt basics of javascript and node js (coltsteel tutor) but when it comes to building my own application, i get stuck .Please suggest me.

Submitted February 09, 2018 at 02:53AM by rjkix

Async Await Promise All Array Destructuring

http://ift.tt/2FXhHcR

Submitted February 08, 2018 at 09:47PM by dalejefferson

Fixing ‘expect’ assertions in Nightwatch.js

http://ift.tt/2ER3FdC

Submitted February 08, 2018 at 10:49PM by kiarash-irandoust

NoDock v1.0.0 - Docker-Powered Node Environment

http://nodock.io/

Submitted February 08, 2018 at 09:56PM by omegafivethreefive

I need good proven Node course?

If anyone had any experience in studying Node from some course share it please.

Submitted February 08, 2018 at 10:46PM by alerrce

windows active directory sso for functional ID to mssql DB

HelloI'm a new guy to Node and webdev and I need some helpI need to provide windows active directory SSO for the webapp, so if a user is not in a specific AD group, they would see an 'access denied' page. I found I can do with node-sspi like this - get a connected users' list of AD groups and check if there is an allowed access group on a list or not. If not I display an error. I'm not sure if it an efficient way to do this kind of authentication or not. Would be happy to see some other ways to achieve SSOBut also I have to use a functional ID to connect to MS SQL Server to do set of REST functions, right now i'm using next modules - mssql with tedious driver. And it require to specify login and password in a config object like this :const config = { user: '...', password: '...', server: 'localhost', database: '...', } and here I have a problem with how to secure my functional ID's login and password - I tried to use Environmental Variable, store config in another config files and add this file in git ignore. But our architects don't like this way, they want to have a SSO for this functional too, they don't want to have functional id's password hard-coded at all.There is my main question - How would you make connection to MSSQL DB with functional ID without specifying password?Thanks for any advise

Submitted February 08, 2018 at 08:28PM by BobsView

Do I Need to Queue Jobs (Like Emails) in Node?

In Ruby on Rails (the web framework I'm most familiar with) the concept of Active Jobs has been baked into the framework for a few years now. If you're sending an email or doing some processing for a new user, you can queue up a Job and take care of the request in the background instead of blocking while we wait.But node and all its modules are asynchronous by default, right? So, if I need to send a user an email, can I just queue up an email and then send the appropriate response without waiting for the email results to come through?I'm seeing that node has similar packages, like kue -- are production apps using something like this for emails and other asynchronous jobs? Or is this only necessary to offload resources in larger high-request applications?

Submitted February 08, 2018 at 08:48PM by aust1nz

libRary 4 GeNERaTinG @nN0y1nG TexTS

http://ift.tt/2FQH8Nl

Submitted February 08, 2018 at 06:13PM by aviaryan

I super need help. :( -- serving static files with Express on Heroku

module.exports vs exports

I already read a lot of websites but I still don't understand the difference between module.exports and exports

Submitted February 08, 2018 at 04:50PM by AnNdreSousa

Learning Go as a Node.js Developer

http://ift.tt/2GYDClq

Submitted February 08, 2018 at 04:19PM by gorgerson

Creating A Google Home App Part 2 - The Game

http://ift.tt/2EP1d7k

Submitted February 08, 2018 at 04:09PM by ThatPigeon

Beginner Problem with Express Router

Hey guys, I have tried for a while now but I just can't find the problem. I have set up a couple of routes using express router and want to put a simple authentication middleware in front of them. It works for a get request on route /search/player but post request ont he same route just ignores the middleware. Here is my code:auth/auth.js:module.exports = function (req, res, next) { if (req.user) return next(); else return res.render('login', { message: "You must be logged in for this." }); } routes/search.js:var express = require('express'); var router = express.Router(); var auth = require('../auth/auth'); var search_controller = require('../controllers/searchController'); router.get('/player', auth, search_controller.search_player_get); router.post('/player', auth, search_controller.search_player_post); [...] module.exports = router; I hope this kind of post is allowed in here. If not, let me know.

Submitted February 08, 2018 at 03:41PM by -jFk-

Choosing "serious" back-end technologies.

(This is for full-stack) Hello,I have been learning front end for the last few months, I want to start with back end now. Because I know JS, should my first choice be node possibly with express?For the databases, which one should I even pick? I read up on mongo, postgres and mysql and:Mongo - "It's bad, noSQL, don't use it, it's not for serious projects."mySQL - "Great too." (Google-ing "mySQL with node" gives MORE relevant links than googling "Postgress with node", the github of the mysql with node-thing has double the watch and stars of the postgress one but the last commit is in November 2017 AND writing mysql on Indeed(dotcom) shows 13k jobs)Postgresql- "Great, learn it." ( I checked if I can use it with node and it can but maybe in a "scuffed" way, like a band-aid? Google-ing node with postgress gives 2 relevant links and MANY irrelevant links, from years ago, a red flag. The github of it has 160 watch, 6k stars, last commit 29 days ago. Writing postgresql on Indeed(dotcom) shows 4k jobs)The questions are mainly pointed towards jobs.Questions:Because I know JS, should I just go with node? Are there a good amount of jobs using node?Which database? Can that DB you chose be used with node(and possibly express)?For mySQL, what language do you even use for it? I'm checking courses on mySQL and top ones are: SQL, PHP (And I think i saw Python).Thank you for your time.

Submitted February 08, 2018 at 02:38PM by khazha88

Promise.prototype.finally is at stage 4

https://mobile.twitter.com/ljharb/status/956229868575846400

Submitted February 08, 2018 at 10:59AM by fagnerbrack

Beginner and really confused with what technologies to use for a web app project

I have an idea of a project that will be mostly a CRUD app where users can submit their posts and rate posts of other users, but in addition to that the web app will have more functionality like monitoring the status of selected Twitch streams in real-time, or pulling and analyzing statistics data from third-party APIs. Eventually I want to add on an iOS/Android app that will connect to my API to provide the same functionality and data from my back-end server.Previously I had experience with PHP and Wordpress trying to do a similar project, however hacking a blog CMS to perform in a very different way was a total pain. So I switched to Django, which seemed quite versatile, however it also felt clunky and I didn't like the process of deploying. Now I am playing around with Node and MEAN stack, and it seems like a breath of a fresh air.But I am really confused about what technologies to use for such a project. Is MEAN stack enough? Or is it an overkill? Or should I look at something different, like Meteor? And am I getting it right that Meteor requires users to have a modern browser for it to work, but what will happen to users with older browsers? I know there are ways to prerender pages to make them static and serve them the good old way (particularly for search engines crawlers), but I suppose that the real-time functionality won't work at all?Thanks in advance.

Submitted February 08, 2018 at 08:52AM by Playhardxd

Which cms to choose to manage the content of ReactNative app ?

Hello everyone,I am developing an application with React Native. This application loads content by making calls to my NodeJS-developed REST API.The content is stored in a MongoDB database. I would like to know if there is a CMS that I can connect to my API or directly to my database to create and manage the content, as well as my users.The problem is that the data model is quite complex and I don't know if there is a turnkey solution to handle complex cases. Ideally, the CMS should be customizable and I can develop even complex cases.I have found several existing solutions (Strapi, forestadmin, KeystoneJS) but I don't know if they meet my needs correctly.Have you ever tried them? Do you know of other alternatives?Thank you very much for reading my question.

Submitted February 08, 2018 at 09:00AM by muskyab

Wednesday 7 February 2018

Body tracking for yoga poses?

Hey guys, I was thinking about a cool app idea where I could analyze a person's yoga techniques via a video feed/file in order to provide them with constructive criticism as to how they could improve their form (against a DB of data scraped from professional instructor videos).I found these some libraries for analyzing video but wasn't sure if they'd fit the bill since they don't provide the specific angles of the people's extremities:http://ift.tt/2E7tGIx help would be GREATLY appreciated!

Submitted February 08, 2018 at 12:20AM by ruuunuharara

New book: Data Wrangling with JavaScript

My book Data Wrangling with JavaScript has launched on the Manning early access program.If you're a JavaScript developer, you already know that working with data is a big deal. Why let the Python and R coders get all the glory? JavaScript isn't just good at data visualization, you can move your entire data wrangling pipeline to JavaScript and work more effectively. Data Wrangling with JavaScript teaches you core data munging techniques in JavaScript, along with many libraries and tools that will make your data tasks even easier.For an overview check out the slide deck:http://ift.tt/2sgyyWe read more on The Data Wrangler:http://ift.tt/2EsNc1k the early access program:http://ift.tt/2sj8U3b

Submitted February 07, 2018 at 10:55PM by ashleydavis75

Need to send hundreds of PARALLEL requests - does a library exist?

Long story short, node doesn't do parallel HTTP requests natively. I can't find a fleshed out library to do this and all I'm able to find with my weak google fu is code snippets or old outdated libraries that only kinda-sorta work.I have a list of IPs that I need to send a series of requests to in parallel (not sequential/consecutive, they HAVE to be done at the SAME TIME). They don't need to resolve at the same time as there's quite a few identical requests that I send to each IP, but the flow I require essentially needs me to start sending them to all IPs at the same time and end whenever.I don't need something that does my entire flow for me, but a proper parallel library would be nice; the overview of my requirements are basically "Send x requests sequentially, but to y peers simultaneously, and handle the responses".

Submitted February 07, 2018 at 10:09PM by n4ru

Built a Video Synchronization Platform using Node and Websockets - I would love feedback! :)

http://ift.tt/2C3Kz0G

Submitted February 07, 2018 at 09:54PM by kyle8998

A reactive Instagram-Clone with some new features developed with MERN stack!! 💪📸👓

http://ift.tt/2E7KJdA

Submitted February 07, 2018 at 07:50PM by yTakkar

Node.js microservices Ecosystem case study available ??

Can anyone please help to guide me about a NODE.js microservices ecosystem. Basically i know various components like ELK (for logging), Promthesus(for Monitoring). If someone can share his experience and knowledge on Node.js miroservices ecosystem with all non functional features like logging,monitoring, process manager (PM2) etc, that would be great for all of us. If there is a case study that would empower us more about the environment.

Submitted February 07, 2018 at 06:37PM by panbhatt

Can't get https request with certificate to work: unable to verify first certificate

I've been working on this for a while, I'm trying to query a server for JSON over https. I went to the server on my browser and downloaded the certificates, converted them to pem and put all three in one file called fullchain.pem. Now when I try to run my node script, I get the error "Unable to verify first certificate". However, when I try to curl the webpage, I get a response by using the same file with --cacert. I'm out of ideas at this point, and would appreciate any help!

Submitted February 07, 2018 at 06:45PM by smileypig2

I made a minimal Node.js blog with Express, Leveldb, and the String Interpolation UI framework

http://ift.tt/2Bhus39

Submitted February 07, 2018 at 05:19PM by thingsthings

Chiccocoin: Learn what is a Blockchain by creating one in NodeJS

http://ift.tt/2EOtTgO

Submitted February 07, 2018 at 04:54PM by thecreazy

Why Developers Love Node.js & what's their main issue with it? Survey Results.

http://ift.tt/2GVk94Z

Submitted February 07, 2018 at 03:25PM by andreapapp

An Exhaustive Guide to Writing Dockerfiles for Node.js Web Apps

http://ift.tt/2E4gzUf

Submitted February 07, 2018 at 01:46PM by PraveenWeb

Install everything to a specific location. Any issues?

This is Windows 10 btw.I've been reading around this subject for a bit and I'm still confused. Some people say it's a nightmare others recommend it.What I want is to install everything Node and NPM in a specific directory. All the stuff that usually goes in program files, all the stuff that goes in appdata, user profile, everything. I'm excluding the stuff that's installed in project directories naturally.I'd have a top level Node directory and then sub directories for each facet of Node/NPM that usually resides in a specific area.Can anyone advise? Any little tips for configuring paths and locations? Big warnings not to do it or encouragement to go for it?The reason for this is manyfold. I'm a bit weird and hate having applications spatter crap everywhere, regardless of the logic behind it. I always forget where everything is, I have my PC set up with various disks for specific things. Mostly it's because I'm a terrible control freak.

Submitted February 07, 2018 at 01:52PM by serentilla

Need help urgent

I have a error in my node application . Would apreciate some help Here's the error : http://ift.tt/2GS1oiN am using a centos vps

Submitted February 07, 2018 at 11:03AM by 123GAMPER321

libRary 4 GeNERaTinG @nN0y1nG TexTS

http://ift.tt/2FQH8Nl

Submitted February 07, 2018 at 11:39AM by aviaryan

How do I export the PATH env in Node.js using execSync?

Hey all.I've run into some trouble with a script I am writing to automate multiple installs, I've resorted to using execSync to execute my commands and everything works exactly like I expect it to until the end. I have to export this path "export PATH=~/.composer/vendor/bin:$PATH" although when executed it doesn't seem to run at all. Any help would be greatly appreciated! If I've not been clear enough just let me know.Code below:const commands = { laravelInstallCommands: [ 'composer global require "laravel/installer=~1.1"', "export PATH=~/.composer/vendor/bin:$PATH" ] }; const laravelInstall = () => { const laravelCommands = commands["laravelInstallCommands"]; for (let keys in laravelCommands) { const data = laravelCommands[keys]; execSync(data, { detached: true, stdio: "inherit", shell: true }); } }; laravelInstall(); Any help would be greatly appreciated. Cheers.

Submitted February 07, 2018 at 12:39PM by Reeferchief

What proxy server do you use?

After years of web development including Node, we aware Node probably not a good choice to handle all requests and have been positive with H2O web server for almost all feature we could do so far. What is your proxy server?

Submitted February 07, 2018 at 09:11AM by proyb2

The WHY behind the WAT: An explanation of JavaScript’s weird type system

http://ift.tt/2EcfpqH

Submitted February 07, 2018 at 07:50AM by fagnerbrack

Tuesday 6 February 2018

Storing values from a textfile

So I'm not sure if this is a JavaScript question or a node question.I started using node two days ago and I figured out how to write words on a textfile and make JavaScript read it. However, now I want the textfile to have numbers that I write ( data ) and I want to store them into variables. Any ideas on how I can do that?Thank you.

Submitted February 06, 2018 at 10:13PM by sadmagnet

Why is the array I edit from a mongoose callback empty after it is done?

I am trying to get documents out of the database (questions) and store them in an array for further use (The questions would be asked to the players).However, when I call findOne(), and add it's result to an array, the array is empty after the callback.. Even though it contains the data in the callback!private LoadQuestions(): iGeneralQuestion[] { const result: iGeneralQuestion[] = []; for (let qid of this.GeneralArguments.questionIds) { QuestionModel.findOne({ id: qid }, (err: any, question: any) => { if (err) return err; if (!question) return question; this.Questions.push({ questionId: question.id, question: question.question, answer: question.answer, otherOptions: question.otherOptions, timeLimit: question.timeLimit, difficulty: question.difficulty //explanation: question.explanation //pictureId: question.pictureId }); console.log(this.Questions); //The array is full here! (Gets filled with each iteration) }); } console.log(this.Questions); //But it doesn't contain anything here! return result; } This is the code that loads the documents, and saves their content in the array.Any help with this? I'm absolutely lost with this, as it shouldn't be about some kind of scope error. The Questions array is a field variable, but it seems to get cleared in the end.

Submitted February 06, 2018 at 10:23PM by SixLiabilities