11 JavaScript Examples to Source Code That Reveal Design Patterns In Use

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • spotify-web-api-node

    A Node.js wrapper for Spotify's Web API.

  • One of my favorite libraries demonstrating the builder pattern in practice is spotify-web-api-node.

  • cheerio

    The fast, flexible, and elegant library for parsing and manipulating HTML and XML.

  • cheerio is a library I still use today that was heavily inspired by the jQuery library, and remains popular today when topics like web scraping come up. It uses chaining to manipulate DOM nodes similarly to jQuery.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • snabbdom

    A virtual DOM library with focus on simplicity, modularity, powerful features and performance.

  • A good repository to learn from this concept is snabbdom, a virtual DOM library that focuses on simplicity, modularity, and powerful features to improve performance when working with the DOM.

  • redux-devtools

    DevTools for Redux with hot reloading, action replay, and customizable UI

  • Powerful middlewares were created to squeeze the most of the pattern's advantages such as being able to time travel in the redux devtools extension.

  • lodash

    A modern JavaScript utility library delivering modularity, performance, & extras.

  • When I first landed my eyes on the lodash repository to examine how their functions were structured, there were times I asked my self "What is the point of this function being here?" because functions like flowRight import another function just to call the function and return the result.

  • babel-handbook

    :blue_book: A guided handbook on how to use Babel and how to create plugins for Babel.

  • I'll be honest, my approach to getting used to working with ASTs is a bit weird, but it worked for me. For some reason the thought of working with the TypeScript AST sounds really attractive to me. I'm sure most people recommend to start deep diving into babel first before getting used to working with an AST with the TypeScript compiler, but I started it the other way around. There is a great library called ts-morph that focuses on making it easier for developers to work with the TypeScript compiler. Learning hands on with ts-morph while getting used to their compiler api made babel much easier to understand without ever touching babel.

  • jQuery

    jQuery JavaScript Library

  • We have actually just seen this technique in the last example, but we can also talk about jQuery that takes advantage of chaining methods together resulting in an easy to read fluent api to work with.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • I'll be honest, my approach to getting used to working with ASTs is a bit weird, but it worked for me. For some reason the thought of working with the TypeScript AST sounds really attractive to me. I'm sure most people recommend to start deep diving into babel first before getting used to working with an AST with the TypeScript compiler, but I started it the other way around. There is a great library called ts-morph that focuses on making it easier for developers to work with the TypeScript compiler. Learning hands on with ts-morph while getting used to their compiler api made babel much easier to understand without ever touching babel.

  • Express

    Fast, unopinionated, minimalist web framework for node.

  • The best example demonstrating this pattern is the expressjs library through the concept of route handling.

  • Immer

    Create the next immutable state by mutating the current one

  • immer uses this pattern by returning to us a draft that represents the object you give to the produce function. What it gets from this pattern is immutability which is great for react apps.

  • twilio-video.js

    Twilio’s Programmable Video JavaScript SDK

  • Their core objects like Participant implements this pattern extensively which enable consumers of the api to create an event driven video chat experiences in their apps.

  • graphql-js

    A reference implementation of GraphQL for JavaScript

  • Visitors are used for many reasons like extensibility, plugins, printing an entire schema somewhere, etc.

  • request

    🏊🏾 Simplified HTTP request client.

  • The request library uses this pattern on nearly all of their class objects.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • 8 NPM Packages for JavaScript Beginners [2024][+tutorials]

    6 projects | dev.to | 2 Apr 2024
  • jQuery 3.6.2 Released

    4 projects | news.ycombinator.com | 14 Dec 2022
  • Gov.uk drops jQuery from their front end

    9 projects | news.ycombinator.com | 19 May 2022
  • Un manual práctico sobre los sistemas de módulos de JavaScript

    5 projects | dev.to | 21 Apr 2022
  • 10 JavaScript and NodeJS Tips that Will Knock Away Multiple Concepts

    5 projects | dev.to | 11 Mar 2022