{"id":32348731,"url":"https://github.com/dominicfallows/gatsby-plugin-json-output","last_synced_at":"2025-10-24T07:58:28.234Z","repository":{"id":34041782,"uuid":"166564778","full_name":"dominicfallows/gatsby-plugin-json-output","owner":"dominicfallows","description":"`gatsby-plugin-json-output` is a Gatsby plugin that generates JSON versions and feeds of your Gatsby content. Fetch JSON content from Gatsby with API-like static feeds that automatically update with your builds.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:52:41.000Z","size":1023,"stargazers_count":13,"open_issues_count":13,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T17:47:17.889Z","etag":null,"topics":["gatsby","gatsby-plugin","json","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gatsby-plugin-json-output","language":"TypeScript","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/dominicfallows.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":"2019-01-19T15:57:49.000Z","updated_at":"2023-09-09T17:46:36.000Z","dependencies_parsed_at":"2023-01-15T04:09:28.490Z","dependency_job_id":null,"html_url":"https://github.com/dominicfallows/gatsby-plugin-json-output","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dominicfallows/gatsby-plugin-json-output","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicfallows%2Fgatsby-plugin-json-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicfallows%2Fgatsby-plugin-json-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicfallows%2Fgatsby-plugin-json-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicfallows%2Fgatsby-plugin-json-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominicfallows","download_url":"https://codeload.github.com/dominicfallows/gatsby-plugin-json-output/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicfallows%2Fgatsby-plugin-json-output/sbom","scorecard":{"id":350618,"data":{"date":"2025-08-11","repo":{"name":"github.com/dominicfallows/gatsby-plugin-json-output","commit":"bd07e5014889aa7cae687695564cb93f1bcb1572"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/13 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T08:12:47.229Z","repository_id":34041782,"created_at":"2025-08-18T08:12:47.229Z","updated_at":"2025-08-18T08:12:47.229Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280761821,"owners_count":26386245,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gatsby","gatsby-plugin","json","typescript"],"created_at":"2025-10-24T07:58:27.077Z","updated_at":"2025-10-24T07:58:28.218Z","avatar_url":"https://github.com/dominicfallows.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gatsby Plugin - JSON Output\n\nFetch JSON content from Gatsby with API-like static feeds that automatically update with your builds.\n\n1) Can create individual JSON view of each generated static HTML file. For example: `/about/index.html` would also have a `/about/index.json`\n2) Can create a set of JSON feed files\n\n## Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Uninstall](#uninstall)\n\n## Install\n\nWith NPM:\n\n```bash\nnpm install gatsby-plugin-json-output\n```\n\nWith Yarn:\n\n```bash\nyarn add gatsby-plugin-json-output\n```\n\n## Usage\n\nSetup requires the following being added to your `gatsby-config.js` like below:\n\n```javascript\n// gatsby-config.js\nconst siteUrl = `https://example.com`\nplugins: [\n  {\n    resolve: `gatsby-plugin-json-output`,\n    options: {\n      siteUrl: siteUrl, // defined on top of plugins\n      graphQLQuery: `\n        {\n          allMarkdownRemark(limit: 1000) {\n            edges {\n              node {\n                excerpt\n                html\n                fields { path }\n                frontmatter {\n                  title\n                  created\n                  updated\n                }\n              }\n            }\n          }\n        }\n      `,\n      serialize: results =\u003e results.data.allMarkdownRemark.edges.map(({ node }) =\u003e ({\n        path: node.fields.path, // MUST contain a path\n        title: node.frontmatter.title,\n        created: node.frontmatter.created,\n        updated: node.frontmatter.updated,\n        html: node.html,\n      })),\n      feedMeta: {\n        author: {\n          name: author,\n        },\n        description: siteDescription,\n        favicon: `${siteUrl}/icons/icon-48x48.png`,\n        title: siteTitle,\n      },\n      serializeFeed: results =\u003e results.data.allMarkdownRemark.edges.map(({ node }) =\u003e ({\n        id: node.fields.path,\n        url: siteUrl + node.fields.path,\n        title: node.frontmatter.title,\n        date_published: new Date(node.frontmatter.created).toISOString(),\n        date_modified: new Date(node.frontmatter.updated).toISOString(),\n        excerpt: node.excerpt,\n      })),\n      feedFilename: \"exampleFeedFilename\",\n      nodesPerFeedFile: 100,\n    }\n  }\n];\n```\n\n### `siteUrl` (required)\n\nThis should be a string of your site's URL.\n\n### `graphQLQuery` (required)\n\nThis needs to be a Gatsby GraphQL query string, that you would pass to `graphql()`. The result of this query must be an array of objects including the path/slug to each static HTML page and the contents you will use to serialize into a JSON file.\n\nFor example, if I wanted to create a JSON file for each of the pages created using [gatsby-transformer-remark](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark), then I might use a query like:\n\n```javascript\n{\n  allMarkdownRemark(limit: 1000) {\n    edges {\n      node {\n        html\n        fields { path }\n        frontmatter {\n          title\n          created\n          updated\n        }\n      }\n    }\n  }\n}\n```\n\nThe `fields { path }` object having been created by something like [gatsby-source-filesystem/#createfilepath](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/#createfilepath).\n\n### `serialize` (optional)\n\nProvide if you want to create individaul JSON files for each node.\n\nThis plugin uses this serialize function to structure the contents of the individual JSON files. You can use this function to restructure the nested nature of `graphQLQuery`. This plugin will pass the results object of the `graphQLQuery` to your `serialize` function.\n\nThis function must return an array of objects with any structure you'd like your JSON files to be.\n\nThe only **required** field is `path` - which must be the relative path from the root of `public` (Gatsby's build output folder) of each static HTML file, like `/about` or `/blog/post-1` etc.\n\nFor the example `graphQLQuery` above, you might provide a function like:\n\n```javascript\n// Using arrow functions\nserialize: results =\u003e\n  results.data.allMarkdownRemark.edges.map(({ node }) =\u003e ({\n    path: node.fields.path, // MUST contain a path\n    title: node.frontmatter.title,\n    created: node.frontmatter.created,\n    updated: node.frontmatter.updated,\n    html: node.html\n  }));\n\n// Or traditional functions\nserialize: function serialize(results) {\n  var nodes = [];\n\n  for (var i = 0; i \u003c results.data.allMarkdownRemark.edges.length; i++) {\n    var node = results.data.allMarkdownRemark.edges[i].node;\n\n    nodes.push({\n      path: node.fields.path, // MUST contain a path\n      title: node.frontmatter.title,\n      created: node.frontmatter.created,\n      updated: node.frontmatter.updated,\n      html: node.html\n    });\n\n    return nodes;\n  }\n}\n```\n\n### feedMeta (optional)\n\nProvide this to include meta into the JSON feed files. This is an optional object, and can be any key-pair shape. A standard feed meta object might be something like:\n\n```javascript\nfeedMeta: {\n  author: {\n    name: \"Ex Ample\",\n  },\n  description: \"Read all the example blog posts from Ex Ample.\",\n  favicon: `https://example.com/icons/icon-48x48.png`,\n  title: \"Ex Ample's Blog\",\n}\n```\n\n### `serializeFeed` (optional)\n\nInclude this if you want to create JSON feed files. If you want to create multiple feed files, add multiple `gatsby-plugin-json-output` objects to `gatsby-config.js`, specify a name using the `feedFilename` field. This is useful if you want to provide feeds with different JSON structures or different data via GraphQL.\n\nThis plugin uses this serializeFeed function to structure the contents of the JSON feed files. You can use this function to restructure the nested nature of `graphQLQuery`. This plugin will pass the results object of the `graphQLQuery` to your `serializeFeed` function.\n\nThis function must return an array of objects with any structure you'd like your JSON feed files to be.\n\nFor the example `graphQLQuery` above, you might provide a function like:\n\n```javascript\n// Using arrow functions\nserializeFeed: results =\u003e results.data.allMarkdownRemark.edges.map(({ node }) =\u003e ({\n  id: nodes.field.path\n  url: path.join(siteUrl, node.fields.path),\n  title: node.frontmatter.title,\n  date_published: new Date(node.frontmatter.created).toISOString(),\n  date_modified: new Date(node.frontmatter.updated).toISOString(),\n  excerpt: node.excerpt,\n}))\n```\n\nOr, a traditional function like the example in the (serialize)[#serialize] section.\n\nYou will find the feed files in the built assets starting from `public/feed-1.json`, then `public/feed-2.json` (etc) as required for the number of posts. For the `feedMata` object and `serialiseFeed` function examples above you would get a JSON feed files in a format like:\n\n```json\n{\n  \"author\": {\n    \"name\": \"Ex Ample\",\n  },\n  \"description\": \"Read all the example blog posts from Ex Ample.\",\n  \"favicon\": \"https://example.com/icons/icon-48x48.png\",\n  \"title\": \"Ex Ample's Blog\",\n  \"feed_url\": \"https://example.com/feed-1.json\",\n  \"home_page_url\": \"https://example.com\",\n  \"items\": [\n    {\n      \"date_modified\": \"2019-03-02T00:00:00.000Z\",\n      \"date_published\": \"2019-03-02T00:00:00.000Z\",\n      \"excerpt\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc at ultricies metus, vel hendrerit magna. Nullam iaculis faucibus feugiat. Mauris mollis, est eu congue placerat, ex odio auctor odio, sed viverra mi nulla in orci.\",\n      \"id\": \"/lorem-ipsum-dolor-sit-amet\",\n      \"title\": \"Lorem ipsum dolor sit amet\",\n      \"url\": \"https://example.com/lorem-ipsum-dolor-sit-amet\",\n    }\n  ],\n  \"next_feed_url\": \"https://example.com/feed-2.json\",\n  \"previous_feed_url\": null,\n  \"version\": \"https://jsonfeed.org/version/1\"\n}\n```\n\n### `feedFilename` (optional)\n\nDefault name is `feed` followed by the page number. Example: `feed-1.json`.\n\nUse this option to set the name of the feed file. This is useful if you want to create multiple feed files for different JSON structures or different data via GraphQL.\n\nTo create multiple feed files, you must add a `gatsby-plugin-json-output` object and options for each feed in `gatsby-config.js`.\n\n### `nodesPerFeedFile` (optional)\n\nThis is an optional number (integer) of nodes to include per feed file. Defaults to 100.\n\n## Uninstall\n\nRemove the config from your `gatsby-config.js`, then:\n\nWith NPM:\n\n```bash\nnpm uninstall gatsby-plugin-json-output\n```\n\nWith Yarn:\n\n```bash\nyarn remove gatsby-plugin-json-output\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicfallows%2Fgatsby-plugin-json-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominicfallows%2Fgatsby-plugin-json-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicfallows%2Fgatsby-plugin-json-output/lists"}