Skip to main content

All Questions

4 votes
2 answers
365 views

web scraper for emails and links

I created a class to scrape URLS, parse and validate emails and get internal links. How can I achieve the SOLID principles in this class written in Javascript to make a web scraper? ...
biel sala's user avatar
5 votes
1 answer
73 views

Class for Switch statements

This is more to get clarity on an implementation that I did. I am working on a React, Node, and Electron application that essentially has a form that a user inputs values that will update some content ...
Grant Herman's user avatar
5 votes
1 answer
353 views

Writing a BitTorrent client in JavaScript

I'm trying to write a JavaScript BitTorrent client in Node.js to get more familiar with the language and ecosystem. I don't know how often people use classes in JavaScript since I feel like the ...
calvines's user avatar
2 votes
0 answers
3k views

Initializing a Node JS Express Application with OOP [closed]

Overview I am attempting to learn Node JS with Express by creating a project. I have seen many examples of setting up an express.js application with functional based programming, like so: ...
Gavin Youker's user avatar
1 vote
1 answer
2k views

Node.js DataBase class for adodb databases

A while ago I was working on a multipurpose database class (an es6 javascript class) that works with any database supporting adodb. This class is a wrapper on the "node-adodb" npm library. This ...
MilesZew's user avatar
  • 167
1 vote
1 answer
46 views

Node router for marketplace routes

After cleaning up & some refactoring, one module of my code became like below. However, I'm feeling like there's still some unnecessary redundancy, and it can be improved further and look neater. ...
kmonsoor's user avatar
  • 113
3 votes
1 answer
84 views

Validity checks for a user signup process

Background: I have been working on a service which allows users to signup on different apps and on each login checks if the request is valid or not based on a series of checks. The below snippet is ...
CodeYogi's user avatar
  • 5,137
5 votes
3 answers
3k views

Poker Holdem Hand Evaluation 7 cards to 5

I'm building a poker Hold'em hand evaluator. Ultimately my goal after building the evaluator is to build a client on the browser but that's far from now. What I've done so far is a hand analyzer that ...
Ced's user avatar
  • 199
1 vote
2 answers
140 views

Print bounding box in the terminal

Right now I am finding ways to write better code in javascript and I see many coding styles used by different authors but right now I am thinking to write code which adheres to the object oriented ...
CodeYogi's user avatar
  • 5,137
0 votes
1 answer
122 views

Calculating the terminal width and height

As part of the bigger problem I am trying to solve smaller problems first and hence below is the code to find the terminal width and height. Code ...
CodeYogi's user avatar
  • 5,137
3 votes
1 answer
311 views

ES6 cron module

I just created my first ES6 module in Node, and first time using promises and I was hoping to get some feedback on it. I am the only developer at my current company, so I cannot get feedback here. I ...
Robert Yates's user avatar
2 votes
2 answers
5k views

Socket.io Node.js Object Oriented Code Structure Approach

following application: Users can join Rooms. A Gameroom inherits from Room and has a queue where Users can queue for a game. If enough people queue they get thrown into a game lobby. Lobby also ...
IDontEven's user avatar
1 vote
1 answer
257 views

Two (or more) LRU caches for a Node.js app

Here is a caching code of a nodejs / typescript app using lru Cache module from https://www.npmjs.com/package/lru-cache. For various reason i need to setup separate caches: one for homeCache another ...
Robert Brax's user avatar
3 votes
1 answer
545 views

Generating sinusoidal music as WAV output in JavaScript ES6

This is a single isomorphic class in ES6, written with the intention of generating a full WAV file given note names and durations in seconds. In JavaScript it can ...
Patrick Roberts's user avatar
1 vote
1 answer
59 views

Exporting a list of projects in Node.JS

I am using the following code in a Node.js / React project. It works fine but it looks like it could be consolidated a little more using a OO pattern. ...
j0e's user avatar
  • 111

15 30 50 per page