Convert Figma logo to code with AI

basarat logotypescript-book

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹

20,710
2,534
20,710
149

Top Related Projects

The Website and web infrastructure for learning TypeScript

Collection of TypeScript type challenges with online judge

44,903

Cheatsheets for experienced React developers getting started with TypeScript

An interactive TypeScript tutorial for beginners

A collection of awesome TypeScript resources for client-side and server-side development. Write your awesome JavaScript in TypeScript

13,967

A collection of essential TypeScript types

Quick Overview

The "typescript-book" repository by basarat is a comprehensive, open-source guide to TypeScript. It covers various aspects of TypeScript programming, from basic concepts to advanced topics, providing developers with a valuable resource for learning and mastering TypeScript.

Pros

  • Extensive coverage of TypeScript features and best practices
  • Free and open-source, making it accessible to all developers
  • Regularly updated to include the latest TypeScript developments
  • Includes practical examples and explanations for better understanding

Cons

  • May be overwhelming for complete beginners due to its comprehensive nature
  • Some sections might become outdated as TypeScript evolves rapidly
  • Lacks interactive coding exercises or quizzes for hands-on practice
  • Navigation can be challenging due to the large amount of content

Code Examples

This is not a code library, so code examples are not applicable.

Getting Started

As this is not a code library but an educational resource, there's no need for installation or setup. To get started with the TypeScript book:

  1. Visit the GitHub repository: https://github.com/basarat/typescript-book
  2. Browse the table of contents in the README.md file
  3. Click on the links to navigate to specific chapters or topics
  4. Read the content online or clone the repository for offline access:
    git clone https://github.com/basarat/typescript-book.git
    
  5. Optionally, you can contribute to the project by submitting pull requests or reporting issues

Competitor Comparisons

The Website and web infrastructure for learning TypeScript

Pros of TypeScript-Website

  • Official Microsoft repository, ensuring up-to-date and accurate information
  • Comprehensive documentation, including playground and handbook
  • Regularly maintained with frequent updates

Cons of TypeScript-Website

  • More complex structure, potentially overwhelming for beginners
  • Focuses on documentation rather than in-depth explanations
  • Less community-driven content compared to typescript-book

Code Comparison

TypeScript-Website (TSConfig reference):

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true
  }
}

typescript-book (TSConfig explanation):

{
  "compilerOptions": {
    "target": "es5", // Specify ECMAScript target version
    "module": "commonjs", // Specify module code generation
    "strict": true, // Enable all strict type-checking options
    "esModuleInterop": true // Enable interoperability between CommonJS and ES Modules
  }
}

The TypeScript-Website provides a concise reference, while typescript-book offers more detailed explanations for each option.

TypeScript-Website serves as the official documentation source, providing comprehensive and up-to-date information. It includes a playground for experimentation and a detailed handbook. However, its structure can be overwhelming for beginners, and it focuses more on documentation than in-depth explanations.

In contrast, typescript-book offers a more beginner-friendly approach with detailed explanations and examples. It's community-driven, allowing for diverse perspectives, but may not always reflect the latest TypeScript updates as quickly as the official repository.

Collection of TypeScript type challenges with online judge

Pros of type-challenges

  • Offers hands-on practice with TypeScript's type system through interactive challenges
  • Provides a wide range of difficulty levels, from beginner to extreme
  • Encourages community contributions and discussions around TypeScript types

Cons of type-challenges

  • Focuses solely on type-level programming, lacking comprehensive TypeScript language coverage
  • May be overwhelming for beginners due to its challenge-based approach
  • Doesn't provide structured learning paths or in-depth explanations of TypeScript concepts

Code Comparison

typescript-book:

interface Point {
  x: number;
  y: number;
}

function printPoint(p: Point) {
  console.log(`${p.x}, ${p.y}`);
}

type-challenges:

type MyPick<T, K extends keyof T> = {
  [P in K]: T[P];
};

type Result = MyPick<{ a: 1; b: 2; c: 3 }, 'a' | 'b'>;
// Result: { a: 1; b: 2 }

The typescript-book example demonstrates basic TypeScript usage with interfaces and functions, while type-challenges focuses on advanced type manipulations and utility types.

44,903

Cheatsheets for experienced React developers getting started with TypeScript

Pros of react

  • Focused specifically on React and TypeScript integration
  • More community-driven with multiple contributors
  • Regularly updated with the latest React and TypeScript features

Cons of react

  • Less comprehensive coverage of general TypeScript concepts
  • May be overwhelming for beginners due to its focus on advanced React patterns
  • Lacks in-depth explanations of TypeScript fundamentals

Code Comparison

typescript-book:

interface User {
  name: string;
  id: number;
}

const user: User = {
  name: "Hayes",
  id: 0,
};

react:

type Props = {
  name: string;
  age: number;
};

const Greeting = ({ name, age }: Props) => (
  <h1>Hello, {name}! You are {age} years old.</h1>
);

The typescript-book example demonstrates basic TypeScript usage, while the react example shows TypeScript integrated with React components.

typescript-book provides a more general introduction to TypeScript, covering a wide range of topics and concepts. It's suitable for beginners and those looking to understand TypeScript in various contexts.

react, on the other hand, is tailored specifically for React developers using TypeScript. It offers practical examples and best practices for combining React and TypeScript, making it ideal for developers working on React projects.

Both repositories serve different purposes and can be complementary resources for developers looking to master TypeScript in different contexts.

An interactive TypeScript tutorial for beginners

Pros of beginners-typescript-tutorial

  • Interactive exercises with immediate feedback
  • Step-by-step approach suitable for absolute beginners
  • Focuses on practical, hands-on learning

Cons of beginners-typescript-tutorial

  • Less comprehensive coverage of advanced TypeScript topics
  • Limited theoretical explanations compared to typescript-book
  • Fewer real-world examples and use cases

Code Comparison

typescript-book:

interface Person {
  name: string;
  age: number;
}

function greet(person: Person) {
  return "Hello, " + person.name;
}

beginners-typescript-tutorial:

type Person = {
  name: string;
  age: number;
};

const greet = (person: Person): string => {
  return `Hello, ${person.name}!`;
};

Both repositories provide valuable resources for learning TypeScript, but they cater to different audiences and learning styles. typescript-book offers a more comprehensive and in-depth coverage of TypeScript concepts, making it suitable for developers who prefer a thorough understanding of the language. It provides extensive explanations and covers advanced topics.

On the other hand, beginners-typescript-tutorial is designed for absolute beginners and focuses on practical, hands-on learning through interactive exercises. It offers immediate feedback and a step-by-step approach, which can be beneficial for those who learn best by doing.

The code comparison shows that both repositories cover similar basic concepts, but may differ in their approach to syntax and best practices. typescript-book tends to use more traditional JavaScript syntax, while beginners-typescript-tutorial leans towards modern ES6+ syntax.

A collection of awesome TypeScript resources for client-side and server-side development. Write your awesome JavaScript in TypeScript

Pros of awesome-typescript

  • Comprehensive collection of TypeScript resources, tools, and libraries
  • Regularly updated with community contributions
  • Covers a wide range of topics beyond just language basics

Cons of awesome-typescript

  • Less structured learning path compared to typescript-book
  • May be overwhelming for beginners due to the sheer volume of information
  • Lacks in-depth explanations and examples for each resource

Code Comparison

typescript-book provides more detailed code examples and explanations:

// typescript-book example
class Animal {
  private name: string;
  constructor(name: string) { this.name = name; }
}

class Cat extends Animal {
  meow() {
    console.log('Meow');
  }
}

awesome-typescript typically links to external resources for code examples:

// Link to TypeScript Playground or other resources
// No direct code examples in the repository

Summary

typescript-book offers a structured, in-depth learning experience for TypeScript, while awesome-typescript provides a vast collection of resources for various skill levels. typescript-book is better suited for beginners and those seeking a comprehensive guide, whereas awesome-typescript serves as an excellent reference for developers looking to explore a wide range of TypeScript-related tools and libraries.

13,967

A collection of essential TypeScript types

Pros of type-fest

  • Focused collection of utility types for TypeScript
  • Regularly updated with new types and improvements
  • Easily installable as an npm package for use in projects

Cons of type-fest

  • Limited explanations and documentation for each type
  • Lacks comprehensive TypeScript language coverage
  • No in-depth tutorials or examples for TypeScript concepts

Code Comparison

type-fest:

type Primitive = string | number | boolean | bigint | symbol | undefined | null;
type Jsonify<T> = T extends Primitive ? T : T extends Map<any, any> | Set<any> ? {} : { [K in keyof T]: Jsonify<T[K]> };

typescript-book:

interface Todo {
  id: number;
  text: string;
  done: boolean;
}

const todo: Todo = {
  id: 1,
  text: "Learn TypeScript",
  done: false
};

Summary

type-fest is a specialized library of utility types, while typescript-book is a comprehensive guide to TypeScript. type-fest offers ready-to-use types for common scenarios, making it valuable for practical development. However, typescript-book provides in-depth explanations and examples, making it better for learning and understanding TypeScript concepts. The choice between them depends on whether you need quick utility types or a thorough learning resource.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

YouTube Channel Subscribers

TypeScript Deep Dive

Learn Professional TypeScript. I've been looking at the issues that turn up commonly when people start using TypeScript. This is based on the lessons from Stack Overflow / DefinitelyTyped and general engagement with the TypeScript community. You can follow for updates and don't forget to ★ on GitHub 🌹

Reviews

  • Thanks for the wonderful book. Learned a lot from it. (link)
  • Its probably the Best TypeScript book out there. Good Job (link)
  • Love how precise and clear the examples and explanations are! (link)
  • For the low, low price of free, you get pages of pure awesomeness. Chock full of source code examples and clear, concise explanations, TypeScript Deep Dive will help you learn TypeScript development. (link)
  • Just a big thank you! Best TypeScript 2 detailed explanation! (link)
  • This gitbook got my project going pronto. Fluent easy read 5 stars. (link)
  • I recommend the online #typescript book by @basarat you'll love it.(link)
  • I've always found this by @basarat really helpful. (link)
  • We must highlight TypeScript Deep Dive, an open source book.(link)
  • Great online resource for learning. (link)
  • Thank you for putting this book together, and for all your hard work within the TypeScript community. (link)
  • TypeScript Deep Dive is one of the best technical texts I've read in a while. (link)
  • Thanks @basarat for the TypeScript Deep Dive Book. Help me a lot with my first TypeScript project. (link)
  • Thanks to @basarat for this great #typescript learning resource. (link)
  • Guyz excellent book on Typescript(@typescriptlang) by @basarat (link)
  • Leaning on the legendary @basarat's "TypeScript Deep Dive" book heavily at the moment (link)
  • numTimesPointedPeopleToBasaratsTypeScriptBook++; (link)
  • A book not only for typescript, a good one for deeper JavaScript knowledge as well. link
  • In my new job, we're using @typescriptlang, which I am new to. This is insanely helpful huge thanks, @basarat! link
  • Thank you for writing TypeScript Deep Dive. I have learned so much. link
  • Loving @basarat's @typescriptlang online book basarat.gitbooks.io/typescript/# loaded with great recipes! link
  • Microsoft doc is great already, but if want to "dig deeper" into TypeScript I find this book of great value link
  • Thanks, this is a great book 🤓🤓 link
  • Deep dive to typescript is awesome in so many levels. i find it very insightful. Thanks link
  • @basarat's intro to @typescriptlang is still one of the best going (if not THE best) link
  • This is sweet! So many #typescript goodies! link

Get Started

If you are here to read the book online get started.

Translations

Book is completely free so you can copy paste whatever you want without requiring permission. If you have a translation you want me to link here. Send a PR.

Other Options

You can also download one of the Epub, Mobi, or PDF formats from the actions tab by clicking on the latest build run. You will find the files in the artifacts section.

Special Thanks

All the amazing contributors 🌹

Share

Share URL: https://basarat.gitbook.io/typescript/

NPM DownloadsLast 30 Days