Best of Node.jsOctober 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·2y

    10 JavaScript concepts every Node developer must master

    Node.js has become a standard for building web apps and systems software, utilizing JavaScript on the back end. Key JavaScript concepts include closures, prototypes, private properties, modules, error handling, currying, call/apply/bind methods, memoization, IIFE, and argument handling. Mastering these concepts can help Node developers write scalable and efficient code, despite the challenges posed by JavaScript's multiparadigm nature and Node's single-threaded architecture.

  2. 2
    Article
    Avatar of javarevisitedJavarevisited·1y

    Optimizing Node.js Performance: Tips and Tricks

    Node.js is renowned for its speed and efficiency in handling multiple simultaneous connections. To ensure your Node.js applications are optimized for performance and scalability, it's crucial to understand and monitor performance metrics like response time, requests per second, CPU and memory usage, and error rates. Key techniques include avoiding blocking operations, minimizing memory usage, implementing caching strategies, and profiling and optimizing code. Furthermore, optimizing database queries, using connection pooling, and employing CDNs can significantly enhance performance. Understanding the event loop and employing best asynchronous programming practices are also critical. Lastly, proper server configuration and deployment practices can help maintain and improve application performance.

  3. 3
    Article
    Avatar of hnHacker News·1y

    solcloud/Counter-Strike: Multiplayer FPS game

    Competitive multiplayer FPS game where players are divided into two teams: Attackers and Defenders. Defenders aim to protect their fan base sanctuary from attackers wielding a graffiti bomb. Win conditions vary depending on successful elimination of opponents or bomb defusal. The game minimizes violence with no visual blood or animal harm. Includes instructions for downloading or building the game and setting up a private server. Contributions to the project are welcome.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Build a Login and Logout API using Express.js (Node.js)

    Learn to build a secure login and logout system using Express.js in Node.js. The tutorial covers setting up development files, installing dependencies, and creating a MongoDB database. It explains the basics of authentication and authorization, the logic for user registration and login, password hashing, and session management using JWT tokens. Additionally, it shows how to implement middleware for verifying user sessions and roles, and how to handle user logout securely.

  5. 5
    Article
    Avatar of webtoolsweeklyWeb Tools Weekly·1y

    JavaScript Utilities, SVG, React Native

    Issue #588 highlights various JavaScript utilities for Node.js and the browser, including caching, regex timing, and file handling libraries. It also features tools for working with media like SVG and video, as well as React Native components for mobile development. Additionally, the post promotes products for handling design systems, ticket reselling, and AI music generation.

  6. 6
    Article
    Avatar of communityCommunity Picks·1y

    TypeScript conquers the command line: The end of Bash?

    TypeScript, traditionally used for web development, is increasingly being adopted for CLI applications thanks to its platform independence, extensive standard library, and familiar syntax. Node.js, along with packages like tsx and ts-node, facilitates easy execution of TypeScript scripts. This creates a more unified development environment, allowing developers to avoid switching between languages like Bash and PowerShell, especially useful in larger software projects.

  7. 7
    Article
    Avatar of logrocketLogRocket·1y

    VineJS vs. Zod for schema validation

    Schema validation ensures data integrity in production-ready applications by enforcing a predefined structure. Writing validation logic manually can be cumbersome, but libraries like VineJS and Zod simplify the process. VineJS, designed for Node.js, offers high performance and a straightforward API for common data types, objects, and arrays. It supports features like pre-compiling schemas for reuse and custom error messages, but is limited to server-side use. Zod, on the other hand, is TypeScript-first and suitable for both frontend and backend projects, offering strong type inference and versatile support for custom validation rules. Benchmarks indicate VineJS performs faster, but Zod has a larger community and more resources.

  8. 8
    Article
    Avatar of hnHacker News·2y

    hcengineering/platform: Huly — All-in-One Project Management Platform (alternative to Linear, Jira, Slack, Notion, Motion)

    The Huly Platform is designed for building business applications like CRM systems and includes several integrated applications. It supports self-hosting via Docker, and setup instructions are provided along with prerequisites such as Node.js and Docker. The platform supports amd64 and arm64 containers and requires Microsoft's Rush for installation and development. Detailed command-line instructions are included for verifying installation, building packages, creating workspaces, and setting up the environment for development and testing purposes.

  9. 9
    Video
    Avatar of freecodecampfreeCodeCamp·1y

    Build a Full Stack Book Store App Using React, Node, MongoDB

    Learn how to build a full stack M Stack application that includes both front end and back end, featuring React on the front end, Node and Express on the back end, and MongoDB as the database. The project will cover essential functionalities such as an admin dashboard, cash on delivery features, inventory management, and a user-friendly interface for adding and removing products. The tutorial also includes JWT for authentication and Redux toolkit for state management.

  10. 10
    Video
    Avatar of communityCommunity Picks·2y

    Modern Redis Crash Course: Backend with Express, TypeScript and Zod

    Learn how to implement Redis in a Node.js project using Express and TypeScript, with a focus on understanding Redis as an in-memory data store and its use cases for caching and primary data storage. The course covers setting up a Redis client, creating middleware for standardized API responses, and using Zod for schema validation. Using a project-based approach, you'll build a restaurant directory backend with endpoints for viewing, ranking, searching, and getting weather information.

  11. 11
    Article
    Avatar of communityCommunity Picks·1y

    Introduction

    Better Fetch is an advanced fetch wrapper for TypeScript, offering features like error-as-value, zod schema validations, advanced type inference, pre-defined routes, hooks, and plugins. It is compatible with browsers, Node.js, workers, Deno, and Bun, supporting custom fetch implementations like node-fetch. Additionally, it includes advanced retry mechanisms with linear and exponential backoff strategies.

  12. 12
    Video
    Avatar of communityCommunity Picks·1y

    Learn NestJS – Complete Course

    Learn the fundamentals of NestJS by building a back end for a Spotify clone. NestJS, built on Node.js, ExpressJS, and TypeScript, embraces Angular concepts to organize and structure server-side applications. The guide covers database design, REST API creation, and deployment. Key components like controllers, providers, modules, middleware, exception filters, and decorators are explained to help manage complex applications. The tutorial walks through setting up a project, creating routes, handling requests with controllers, using services for business logic, and connecting to databases with TypeORM.

  13. 13
    Article
    Avatar of logrocketLogRocket·2y

    Using the built-in SQLite module in Node js

    Node.js v22.5.0 has introduced a native SQLite module, albeit in an experimental phase. This module allows developers to create databases either in memory or in a specified file without requiring external dependencies. The post provides a comprehensive guide to using this built-in SQLite module, including building a simple to-do app with Express.js, bcrypt, and nanoid. While the module offers a lightweight, embedded database solution, it currently supports only synchronous queries and lacks custom build options and extensions. It highlights the module's ease of use compared to third-party packages like node-sqlite3 and better-sqlite3.

  14. 14
    Article
    Avatar of cerbosCerbos·1y

    Implement authorization and access control in an Express application

    Learn how to implement role-based access control (RBAC) in an Express application using Cerbos PDP. This guide covers necessary installations, setting up a project, defining roles and permissions through policy files, and configuring routes to enforce RBAC. The example uses a learning management system to demonstrate the process.

  15. 15
    Article
    Avatar of nodejsdevelopersNode.js developers·1y

    How are you all feeling about sharing Bun and Deno updates here too?

    A discussion is raised about whether updates on Deno and Bun, which are server-side JavaScript runtimes similar to Node.js and aim for npm-like compatibility, should be shared in a Node.js developers group. Members are asked if they agree or if they'd prefer the focus to remain exclusively on Node.js.

  16. 16
    Article
    Avatar of communityCommunity Picks·1y

    The Ultimate JavaScript Cheatsheet Collection 🚀

    Discover a curated compilation of essential JavaScript cheatsheets for various technologies including Vanilla JavaScript, React, Vue.js, and Node.js. This extensive collection is designed to simplify the coding experience for both beginners and seasoned developers, offering quick references for syntax, methods, and key concepts. Enhance your development journey with these valuable resources!

  17. 17
    Article
    Avatar of nodejsdevelopersNode.js developers·2y

    Node.js API docs funny statement 😁

    A user shares a humorous statement found in the official Node.js API documentation, which they discovered while looking up a reference for a friend.

  18. 18
    Article
    Avatar of cloudflareCloudflare·1y

    The story of web framework Hono, from the creator of Hono

    Hono is a fast, lightweight web framework that works across various JavaScript environments, including Cloudflare Workers, Deno, Bun, and Node.js. It uses a Trie tree-based router and adheres to Web Standards, ensuring a 'write once, run anywhere' experience. Hono simplifies development with concise syntax, built-in middleware, strong type system, and server-side JSX support. It also has features for authentication, context model for state management, and robust testing capabilities. Recent updates include static site generation, client components, and file-based routing, allowing full-stack application development.

  19. 19
    Article
    Avatar of freecodecampfreeCodeCamp·1y

    How to Use Object Relational Mapping in Node.js – Optimize Database Interactions With Sequelize ORM

    Databases are crucial for applications, and Object Relational Mapping (ORM) helps streamline their communications. This post explains ORM, its benefits like reduced data manipulation risks and easier database interaction, and demonstrates using Sequelize ORM with a Node.js and MySQL setup. Key steps include setting up a Node.js server, integrating Sequelize, and building a project with CRUD operations. Practical examples are provided to illustrate how ORM improves database management.

  20. 20
    Article
    Avatar of attiAT&T Israel·2y

    Memory Leak Profiling and Pinpointing for Node.js

    We identified and fixed a memory leak in a Nest.js application running on Kubernetes, which was caused by open handles not being properly closed during proxy requests to Grafana. Using Prometheus and Grafana for monitoring, along with custom modifications to the wtf-node dependency, we pinpointed the issue and adjusted the middleware to prevent the memory leak. Key steps include integrating prom-client with Grafana and using wtf-node to diagnose active handle issues.

  21. 21
    Video
    Avatar of mattpocockMatt Pocock·1y

    Going weirdly deep on console.log

    Discover ways to enhance console logging in Node.js. Learn how to use util.inspect for detailed object inspection, including setting the depth and adding colors. Understand how console.dir can achieve similar results without importing util.

  22. 22
    Video
    Avatar of denoDeno·2y

    Programming should be simple

    Programming should be simple. Ryan Dahl, the creator of Node.js, critiques the complexity of modern Node.js setups, highlighting cumbersome processes like configuring TypeScript. He introduces Deno, a new platform that prioritizes simplicity, integrating TypeScript support out-of-the-box, providing all-in-one tooling, and ensuring security by default, while maintaining compatibility with existing npm packages.

  23. 23
    Article
    Avatar of communityCommunity Picks·1y

    Understanding and Using Javascript Console API

    The console API in JavaScript is used for debugging, printing messages, and transferring various information to the console in environments like browsers and Node.js. This guide explains the console object and its methods, including console.log, console.debug, console.error, console.warn, console.dir, console.dirxml, console.assert, and console.count. Each method serves a specific purpose, such as logging errors, warnings, or debugging information, and can facilitate more effective debugging practices.

  24. 24
    Article
    Avatar of codropsCodrops·1y

    Simplifying Backend Tasks for Frontend Developers with Manifest, a One-File Solution

    Manifest is an open-source tool designed to simplify backend tasks for frontend developers by using a single YAML file to create a complete backend. It includes features like a non-technical admin panel, a functional REST API, and an abstracted database for easy management. Built for simplicity and inclusivity, Manifest aims to bridge the gap between frontend and backend development, making it accessible even for those with minimal backend expertise.

  25. 25
    Article
    Avatar of nodejsdevelopersNode.js developers·1y

    What content do you want to read about in Node.js?

    The post seeks input on various topics of interest related to Node.js, such as deploying Node.js on cloud providers, using Node.js for AI workflows, exploring new runtime features, understanding Node.js initiatives and working groups, and security practices. Readers are encouraged to suggest or vote on topics they find most intriguing.