{"id":13553993,"url":"https://github.com/prisma-archive/prep","last_synced_at":"2026-01-11T22:50:46.830Z","repository":{"id":57278150,"uuid":"58274171","full_name":"prisma-archive/prep","owner":"prisma-archive","description":"Pre-renders your web app (React, Vue, Angular, ...) into static HTML based on your specified routes enabling SEO for single page applications.","archived":false,"fork":false,"pushed_at":"2018-11-24T12:51:38.000Z","size":115,"stargazers_count":370,"open_issues_count":13,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T10:06:22.672Z","etag":null,"topics":["apollographql","graphcool","prerender","react","seo","server-side-rendering","vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prisma-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-07T16:24:02.000Z","updated_at":"2025-02-28T03:02:52.000Z","dependencies_parsed_at":"2022-09-06T20:12:38.632Z","dependency_job_id":null,"html_url":"https://github.com/prisma-archive/prep","commit_stats":null,"previous_names":["graphcool/isomorph","graphcool/prep"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fprep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fprep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fprep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fprep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prisma-archive","download_url":"https://codeload.github.com/prisma-archive/prep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640465,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollographql","graphcool","prerender","react","seo","server-side-rendering","vue"],"created_at":"2024-08-01T12:02:37.525Z","updated_at":"2026-01-11T22:50:46.820Z","avatar_url":"https://github.com/prisma-archive.png","language":"JavaScript","readme":"\u003e `prep` has been deprecated in favor of newer tools like [Gatsby](https://www.gatsbyjs.org/) and [Next.js](https://nextjs.org/)\n\n# prep [![npm version](https://badge.fury.io/js/prep.svg)](https://badge.fury.io/js/prep)\n\nPre-renders your web app into static HTML based on your specified routes enabling SEO for single page applications.\n\n\u003e NOTE: `prep` is now based on [Chromeless](https://github.com/prismagraphql/chromeless). We'll shortly release an updated version.\n\n## Features\n\n* 🔎 Makes your single page app SEO friendly\n* 🚀 Improves loading speed up to 400x\n* ✨ Incredibly flexible and easy to use \n* 📦 Works out-of-the-box with any framework (React, Angular, Backbone...). No code-changes needed.\n\n## Install\n\n```sh\nnpm install -g prep\n```\n\n## Usage\n\nJust run `prep` in your terminal or add it to the `scripts` as part of your build step in your `package.json`. If you don't provide a `target-dir` the contents of the `source-dir` will be overwritten.\n\n```sh\n  Usage: prep [options] \u003csource-dir\u003e [target-dir]\n\n  Options:\n\n    -h, --help           output usage information\n    -c, --config [path]  Config file (Default: prep.js)\n    -p, --port [port]    Phantom server port (Default: 45678)\n```\n\nIn order to configure the routes which you'd like to pre-render you need to specifiy them in a Javascript config file with the following schema. If you don't provide a config file, `prep` will just pre-render the `/` route.\n\n```js\nconst defaultConfig = {\n  routes: ['/'],\n  timeout: 1000,\n  dimensions: {\n    width: 1440,\n    height: 900,\n  },\n  https: false,\n  hostname: 'http://localhost',\n  useragent: 'Prep',\n  minify: false,\n  concurrency: 4,\n  additionalSitemapUrls: [],\n}\n```\n\n* `routes` specifies the list of routes that the renderer should pass. (Default: `['/']`)\n* `timeout` is the timeout for how long the renderer should wait for network requests. (Default: `1000`)\n* `dimensions` the page dimensions in pixels that the renderer should use to render the site. (Default: `1440` x `900`)\n* `https` prep uses https if true otherwise http\n* `hostname` is used to show the correct urls in the generated sitemap that is stored in `[target-dir]/sitemap.xml`\n* `useragent` is set a `navigator.userAgent`\n* `minify` is a boolean or a [html-minifier](https://github.com/kangax/html-minifier) configuration object.\n* `concurrency` controls how many routes are pre-rendered in parallel. (Default: `4`)\n* `additionalSitemapUrls` is a list of URLs to include as well to the generated `sitemap.xml`. (Default: `[]`)\n\n## Example `prep.js`\n\nThere are three different ways to configure `prep`. Which one you pick depends on your use case.\n\n### 1. Javascript Object\n\nThe probably easiest way is to export a simple Javascript object.\n\n```js\nexports.default = {\n  routes: [\n    '/',\n    '/world'\n  ]\n}\n```\n\n### 2. Synchronous Function\n\nYou can also return a function that returns the config for `prep`.\n\n```js\nexports.default = () =\u003e {\n  return {\n    routes: [\n      '/',\n      '/world'\n    ]\n  }\n}\n```\n\n### 3. Asynchronous Function (Promise)\n\nFurthermore you can also return a `Promise` or use ES7 features such as `async` \u0026 `await` (Babel pre-compile step needed).\n\n```js\nexport default async () =\u003e {\n  const routes = await getRoutesAsync()\n  return { routes }\n}\n```\n\n## How it works\n\nThe concept behind `prep` is very simple. `prep` starts a temporary local webserver and opens your provided routes via [PhantomJS](http://phantomjs.org/). Each route will be exported as a static HTML file. The resulting folder structure is the same as the structure of your routes.\n\n## Known Issues\n\n - If you want to use `Object.assign()` in your code, please add a polyfill like [phantomjs-polyfill-object-assign](https://github.com/chuckplantain/phantomjs-polyfill-object-assign), because prep uses PhantomJS, which doesn't support `Object.assign()` yet.\n\n\n## Help \u0026 Community [![Slack Status](https://slack.graph.cool/badge.svg)](https://slack.graph.cool)\n\nJoin our [Slack community](http://slack.graph.cool/) if you run into issues or have questions. We love talking to you!\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://oss.prisma.io\"\u003e\u003cimg src=\"https://imgur.com/IMU2ERq.png\" alt=\"Prisma\" height=\"170px\"\u003e\u003c/a\u003e\u003c/p\u003e\n","funding_links":[],"categories":["JavaScript","vue"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-archive%2Fprep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprisma-archive%2Fprep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-archive%2Fprep/lists"}