Managing Dates and Times Using Moment.js – Website Design Article

Working with dates and times in JavaScript has always been a bit cumbersome. Native date methods are verbose and the API is often inconsistent. That’s why if you ask a date-related question on StackOverflow, you’ll often hear the reply “Use Moment.js”. What Is Moment.js? Moment.js is a Swiss Army knife for working with dates in JavaScript. It allows you to parse, validate, manipulate, and display dates and times using a clean and concise API. In this article I’ll show you…

Read More

Build a Native Desktop GIF Searcher App Using NodeGui — SitePoint – Website Design Article

NodeGui is an open-source library for building cross-platform, native desktop apps with Node.js. NodeGui apps can run on macOS, Windows, and Linux. The apps built with NodeGui are written using JavaScript, styled with CSS and rendered as native desktop widgets using the Qt framework. Some of the features of NodeGui are: native widgets with built-in support for dark mode low CPU and memory footprint styling with CSS including complete support for Flexbox layout complete Node.js API support and access to…

Read More

An Introduction to MongoDB — SitePoint – Website Design Article

MongoDB is a cross-platform, open-source, NoSQL database, used by many modern Node-based web applications to persist data. In this beginner-friendly tutorial, I’ll demonstrate how to install Mongo, then start using it to store and query data. I’ll also look at how to interact with a Mongo database from within a Node program, and also highlight some of the differences between Mongo and a traditional relational database (such as MySQL) along the way. What Is MongoDB? MongoDB is a document-oriented database.…

Read More

How to Divert Traffic Using IP2Location in a Next.js Website — SitePoint – Website Design Article

This article was created in partnership with IP2Location. Thank you for supporting the partners who make SitePoint possible. In a world where online commerce has become the norm, we need to build websites that are faster, user friendly and more secure than ever. In this article, you’ll learn how to set up a Node.js powered website that’s capable of directing traffic to relevant landing pages based on a visitor’s country. You’ll also learn how to block anonymous traffic (e.g. Tor)…

Read More

How to Build Your First Discord Bot with Node.js — SitePoint – Website Design Article

Nowadays, bots are being used for automating various tasks. Since the release of Amazon’s Alexa devices, the hype surrounding automation bots has only started to grow. Besides Alexa, other communication tools like Discord and Telegram offer APIs to develop custom bots. This article will solely focus on creating your first bot with the exposed Discord API. Maybe the most well-known Discord bot is the Music Bot. The music bot lets you type a song name and the bot will attach…

Read More

How to Create a QR Code – Website Design Article

QR codes aren’t everyone’s cup of tea but I quite like them. If I see something I want to remember or check out later, especially when on the road, it’s super easy to take a quick picture — it’s much easier than trying to remember a URL and much faster than typing it in on a tiny keyboard. If you need to generate QR codes, for a client or yourself, there’s a really nice JavaScript project: node-qrcode. Let’s look at…

Read More

Build a JavaScript Command Line Interface (CLI) with Node.js — SitePoint – Website Design Article

As great as Node.js is for “traditional” web applications, its potential uses are far broader. Microservices, REST APIs, tooling, working with the Internet of Things and even desktop applications: it’s got your back. Another area where Node.js is really useful is for building command-line applications — and that’s what we’re going to be doing in this article. We’re going to start by looking at a number of third-party packages designed to help work with the command line, then build a…

Read More

How to Build Your First Telegram Chatbot with Node.js — SitePoint – Website Design Article

So, this morning you woke up with the idea to develop a way to store and label interesting articles you’ve read. After playing with the idea, you figure a Telegram chatbot is the most convenient solution for this problem. In this guide, we’ll walk you through everything you need to know to build your first Telegram chatbot using JavaScript and Node.js. To get started, we have to register our new bot with the so-called Botfather to receive our API access…

Read More

How to Not Minify Source with webpack – Website Design Article

The webpack JavaScript utility has taken over the modern JavaScript landscape, so much so that it’s hard to be a JavaScript developer and not use it. JavaScript build utilities are the point where they do best practices implicitly, like minify code, caching, and more. I was recently debugging a bundled webpack app and it quickly became clear that the only way forward was debugging the actual source, not the minified code. Duh.y To prevent webpack from minifying the source, add…

Read More

A Beginner’s Guide to npm — the Node Package Manager — SitePoint – Website Design Article

Node.js makes it possible to write applications in JavaScript on the server. It’s built on the V8 JavaScript runtime and written in C++ — so it’s fast. Originally, it was intended as a server environment for applications, but developers started using it to create tools to aid them in local task automation. Since then, a whole new ecosystem of Node-based tools (such as Grunt, Gulp and Webpack) has evolved to transform the face of front-end development. This popular article was…

Read More

Optimize the Performance of a Vue App with Async Components — SitePoint – Website Design Article

Want to learn Vue.js from the ground up? Get an entire collection of Vue books covering fundamentals, projects, tips and tools & more with SitePoint Premium. Join now for just $9/month or try our 7 day free trial. Single-page applications sometimes cop a little flack for their slow initial load. This is because traditionally, the server will send a large bundle of JavaScript to the client, which must be downloaded and parsed before anything is displayed on the screen. As…

Read More

Top 10 IDEs for Developing Node.js Apps – Website Design Article

Having control over code is an important part of a software application development process. A lot of programmers need efficient code editing and debugging tools to work with accuracy and speed. This may be the reason as to why an IDE (Integrated development environment) was conceptualized. An IDE has a source code editor, a code debugger, code completion feature, build automation tool, compiler and more all in one single software application. Modern IDEs have a graphical user interface with a…

Read More

Create an Automated Scoreboard that Senses Your Score with a Raspberry Pi — SitePoint – Website Design Article

On an impulse just before Christmas, I bought myself an NBA “over-the-door” mini basketball hoop. I wasn’t sure what I’d do with it, but having a basketball hoop for my office seemed like a good move. In the end I decided to experiment and bring some connectivity to it by hooking it up to a Raspberry Pi to give it a scoreboard display. Here’s how that went, with step-by-step instructions if you’d like to try to adapt and improve upon…

Read More