{"_id":"@binghamchris/gatsby-plugin-json-pages","name":"@binghamchris/gatsby-plugin-json-pages","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@binghamchris/gatsby-plugin-json-pages","version":"1.0.0","description":"Create JSON only pages at Gatsby build time.","main":"index.js","keywords":["gatsby","gatsby-plugin","gatsby-plugin-json-pages","json","graphql","pages"],"repository":{"type":"git","url":"git+https://github.com/binghamchris/gatsby-plugin-json-pages.git"},"author":{"name":"Jamie Barton"},"license":"MIT","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"bugs":{"url":"https://github.com/binghamchris/gatsby-plugin-json-pages/issues"},"homepage":"https://github.com/binghamchris/gatsby-plugin-json-pages#readme","_id":"@binghamchris/gatsby-plugin-json-pages@1.0.0","gitHead":"8a434149d5f5b93a8d2287a0af1185bccfc69400","_nodeVersion":"20.12.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-kUYv5MRowr3WZrwrTgk9L6HftpFDOYoV85p0vpQPC57zNSzdYZG1sDvrYnNjR6ytJ/NqCF70ZrwPcJxjrutIyA==","shasum":"7c39deb6827c865c2a4c66cdc9ada690b47bd348","tarball":"https://registry.npmjs.org/@binghamchris/gatsby-plugin-json-pages/-/gatsby-plugin-json-pages-1.0.0.tgz","fileCount":4,"unpackedSize":2643,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDipJQOsWOO6ZlQua1gL0ROvAH5VhmJqnwtyySbBMCsRwIgdOwHHe2HGho1ZHX6yjm4qn35pvC93pBrsv8BS3HBG28="}]},"_npmUser":{"name":"binghamchris","email":"chris@pearit.co.uk"},"directories":{},"maintainers":[{"name":"binghamchris","email":"chris@pearit.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-json-pages_1.0.0_1723879810839_0.05284444430166846"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-17T07:30:10.752Z","1.0.0":"2024-08-17T07:30:11.014Z","modified":"2024-08-17T07:30:11.307Z"},"maintainers":[{"name":"binghamchris","email":"chris@pearit.co.uk"}],"description":"Create JSON only pages at Gatsby build time.","homepage":"https://github.com/binghamchris/gatsby-plugin-json-pages#readme","keywords":["gatsby","gatsby-plugin","gatsby-plugin-json-pages","json","graphql","pages"],"repository":{"type":"git","url":"git+https://github.com/binghamchris/gatsby-plugin-json-pages.git"},"author":{"name":"Jamie Barton"},"bugs":{"url":"https://github.com/binghamchris/gatsby-plugin-json-pages/issues"},"license":"MIT","readme":"# gatsby-plugin-json-pages\n\nGatsby plugin for creating static `.json` files at build.\n\nPlease Note: I've copied this repo from [notrab/gatsby-plugin-json-pages](https://github.com/notrab/gatsby-plugin-json-pages) in order to continue using this code in my projects, as this repo and the associated npm package seem to have been removed.\n\n## Installation\n\n```shell\nyarn add gatsby-plugin-json-pages\n```\n\n## How to use\n\nSimply provide an array of `pages` that each include the `fileName`, `query`, and `transformer`. The `transformer` function is recommended, but by default the response from `query` will be stringified.\n\n```js\n// gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: \"gatsby-plugin-json-pages\",\n      options: {\n        pages: [\n          {\n            fileName: \"products\",\n            query: `\n              query {\n                allGraphCmsProduct {\n                  nodes {\n                    id\n                    prices {\n                      amount\n                      currency\n                    }\n                  }\n                }\n              }\n            `,\n            transformer: ({\n              data: {\n                allGraphCmsProduct: { nodes },\n              },\n            }) => nodes,\n          },\n        ],\n      },\n    },\n  ],\n};\n```\n","readmeFilename":"README.md"}