---
title: Examples
description: Start from an example.
---

import { readdirSync, lstatSync, readFileSync } from 'fs'
import path from 'path'
import { ExamplesArea } from "../../../../components/ExamplesArea";

export const getStaticProps = ({ params }) => {
  // path to examples directory at the monorepo root.
  const examplesDirectory = path.join(__dirname, '../../../../../../../examples')
  const examples = [];
  readdirSync(examplesDirectory).forEach(file => {
    if (lstatSync(path.join(examplesDirectory, file)).isDirectory()) {
      try {
        examples.push({
          slug: file,
          ...JSON.parse(readFileSync(path.join(examplesDirectory, file, "meta.json")).toString())
          }
        );
      } catch (err) {
        console.log(`No meta.json found for ${file}, excluding from docs`);
      }
    }
  });
  // throw an error if no examples are found
  if (examples.length === 0) {
    throw new Error(
      `No examples found in ${examplesDirectory}! Make sure you have updated the path if moving this file.`
    )
  }
  return {
    props: {
      ssg: {
        examples
      }
    },
    revalidate: 60 * 60 * 24
  }
}

# Turborepo Examples

Clone a Turborepo starter repository to get a head start on your monorepo.

<ExamplesArea filter='all' />

For even more examples and starters, see the [Turborepo examples directory on GitHub](https://github.com/vercel/turbo/tree/main/examples).
