Skip to content
Tutorials Center
My learning

Topics

JSON, XML, YAML and Markdown Tutorial

Learn JSON, XML, YAML and Markdown step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Are Data Formats? Learn what a data format is, why programs need one, and how JSON, XML, YAML and Markdown differ, with the same record written four ways and run in your browser.
  2. 2 Choosing the Right Format Compare JSON, XML, YAML, TOML, CSV and Markdown by readability, size, types, comments and tooling, and learn a simple checklist for picking the right one.
  3. 3 Text Encoding and Syntax Basics Understand characters versus bytes, UTF-8, the byte order mark, escaping, line endings and whitespace rules, the basics that make JSON, XML and YAML parse correctly.
  4. 4 Tools for Working with Data Formats A practical tour of the tools for data formats: editors and linters, command-line helpers like jq and xmllint, parser libraries by language, and how to build your own mini tools.

JSON in Depth

  1. 5 JSON Syntax Learn the complete JSON grammar: objects, arrays, strings, numbers, booleans and null, the allowed whitespace, and the most common syntax mistakes, with live examples.
  2. 6 JSON Types, Numbers and Dates See how JSON maps to language types, why floating-point and 64-bit integers cause bugs, how to store money, dates and binary data, and how to preserve precision.
  3. 7 JSON.parse and JSON.stringify Master JSON.parse and JSON.stringify: error handling, pretty printing, what gets dropped, deep copies, circular references and safe parsing patterns with runnable examples.
  4. 8 Replacers, Revivers and toJSON Customize JSON conversion in JavaScript with replacer functions, key allow-lists, reviver functions and toJSON methods, with practical examples for dates, secrets and classes.
  5. 9 JSON Pitfalls and Variants Avoid common JSON mistakes, then meet its variants: JSON Lines for streams, JSONC and JSON5 for config files, and binary relatives like BSON and MessagePack.

JSON Schema

  1. 10 JSON Schema: An Introduction Learn what JSON Schema is, why it beats hand-written checks, how a schema describes a document, and how to validate data with a runnable mini validator and clear error messages.
  2. 11 JSON Schema Types and Constraints Constrain values with JSON Schema: type, enum, const, numeric ranges, string length, regular expression patterns and format, with a runnable validator and clear error output.
  3. 12 JSON Schema for Objects and Arrays Describe nested objects and lists with JSON Schema: properties, required, additionalProperties, dependentRequired, items, prefixItems, uniqueItems and contains, with runnable examples.
  4. 13 JSON Schema Composition, $ref and Conditionals Combine and reuse JSON Schemas with allOf, anyOf, oneOf, not, $ref, $defs and if/then/else, including discriminated unions and reusable definitions, with runnable examples.

XML, XPath and XSLT

  1. 14 XML Syntax and Structure Learn XML from the start: elements, attributes, text, comments, CDATA, the declaration, well-formedness rules and the document tree, with a runnable mini parser.
  2. 15 XML Namespaces, Entities and Processing Instructions Understand XML namespaces and prefixes, default namespaces, why namespace URIs matter, custom entities, processing instructions, xml:lang and xml:space, with runnable examples.
  3. 16 Validating XML with DTD and XML Schema Learn how DTDs and XML Schema (XSD) define valid XML documents, with element declarations, complex types, occurrence rules, restrictions, and a runnable mini validator.
  4. 17 XPath Basics Learn XPath to select elements, attributes and text from XML: path steps, descendants, predicates, wildcards, axes, functions and common patterns, with a runnable mini evaluator.
  5. 18 XSLT Basics โ€“ Transforming XML Learn XSLT, the XML transformation language: stylesheets, templates, apply-templates, for-each, value-of, sorting, conditions and output formats, with a runnable template-engine stand-in.

YAML and Config Files

  1. 19 YAML Syntax Basics Learn YAML from scratch - indentation, key-value mappings, sequences, comments, scalar types and quoting - with a small runnable parser that shows how the text becomes data.
  2. 20 Multi-line Text and Flow Style in YAML Learn YAML block scalars (| and >), chomping indicators, quoted multi-line strings, flow sequences and mappings, and when each style is the clearest choice.
  3. 21 Anchors, Aliases, Tags and Documents in YAML Reuse YAML data with anchors, aliases and merge keys, force types with tags, and keep several documents in one file - with runnable models of how each feature resolves.
  4. 22 YAML Gotchas - The Norway Problem and Other Pitfalls Learn the YAML pitfalls that break real files - the Norway problem, octal and sexagesimal numbers, version strings, duplicate keys, tabs - and how to write YAML that survives any parser.
  5. 23 Configuration Files: Layers, Env Vars and Formats Learn how applications read configuration - choosing a format, .env and INI files, environment variables, deep merging and precedence from defaults to command-line flags - with runnable Node examples.

TOML, CSV and Other Formats

  1. 24 TOML in Depth Learn TOML, the explicit configuration format - key/value pairs, strings, numbers, dates, arrays, tables, inline tables and arrays of tables - with a runnable subset parser in Node.
  2. 25 CSV Parsing and Its Pitfalls Learn the CSV format and RFC 4180 rules - quoting, embedded commas and newlines, delimiters, BOM and encodings, type inference - and write a correct CSV parser and writer in Node.
  3. 26 INI, .properties and Other Plain-Text Formats Learn the simple line-oriented data formats still found everywhere - INI, Java .properties, TSV, logfmt and fixed-width records - with parsers you can run and the pitfalls of each dialect.
  4. 27 JSON Lines and Binary Formats Learn JSON Lines for streaming records and the binary alternatives MessagePack, CBOR, BSON and Protocol Buffers - how they encode data, what they save, and how to build a tiny encoder in Node.

Markdown and Documentation

  1. 28 Markdown Syntax: The Complete Guide Learn all core Markdown syntax - headings, emphasis, lists, links, images, code, quotes, rules and HTML - with the CommonMark rules for edge cases and runnable Node examples.
  2. 29 GitHub Flavored Markdown and Front Matter Learn GitHub Flavored Markdown extensions - tables, task lists, strikethrough, autolinks, alerts, footnotes - and YAML front matter, with parsers you can run in Node.
  3. 30 Writing a Markdown-to-HTML Converter Build a small Markdown renderer step by step - escaping, block parsing, inline parsing, links and code spans - and learn why production parsers use a syntax tree and why escaping comes first.
  4. 31 Documentation with Markdown Learn how to write and maintain project documentation in Markdown - README structure, changelogs, architecture decision records, docs as code, link checking and documentation linting - with runnable checks.

Parsing, Security and Tooling

  1. 32 Writing a Tokenizer and Parser Learn how data-format parsers work by building a JSON tokenizer and recursive-descent parser in Node, with line and column errors, depth limits and tests against the built-in JSON.parse.
  2. 33 Data Format Security Learn how data formats are attacked - prototype pollution, unsafe YAML loading, XXE and entity expansion, CSV formula injection, Markdown XSS, oversized input - and the defences that stop each one.
  3. 34 Choosing a Format and Converting Between Them Compare JSON, XML, YAML, TOML, CSV and Markdown by purpose, then learn to convert between them safely - flattening nested data, mapping types, and spotting what each conversion loses.
  4. 35 Command-Line Data Tools Learn the command-line tools for working with JSON, YAML, XML and CSV - jq, yq, xmllint, Miller, csvkit and linters - plus how queries and schema validation work, with runnable Node stand-ins.

Projects and Practice

  1. 36 Project: A Layered Configuration Loader Build a complete configuration loader in Node - defaults, INI-style file, .env text, environment variables and command-line flags merged in order, validated against a schema, with provenance for every value.
  2. 37 Project: A JSON Lines Log Analyser Build a streaming log analyser in Node - parse JSON Lines, skip bad lines, validate records, aggregate counts and percentiles, and publish the report as CSV, JSON and a Markdown table.
  3. 38 Project: A Static Page Builder from Markdown Build a tiny static site generator in Node - read Markdown files with front matter, render HTML with heading anchors, create an index and navigation, validate links, and write finished pages.
  4. 39 Practice: Data Format Exercises Practice YAML quoting, CSV statistics, JSON Lines deduplication, Markdown link extraction and flat-to-nested conversion with five worked exercises, hints, runnable solutions and self-tests.