All Questions
Tagged with node.js object-oriented
25 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?
...
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 ...
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 ...
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:
...
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 ...
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. ...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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 ...
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 ...
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.
...