{"_id":"@arnau/gatsby-transformer-toml","_rev":"3-756723a1f0eb53b19259e75d3e7ce1bf","name":"@arnau/gatsby-transformer-toml","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@arnau/gatsby-transformer-toml","version":"1.0.0","description":"Gatsby transformer plugin for toml","main":"index.js","scripts":{"build":"babel src --out-dir . --ignore **/__tests__","prepare":"npm run build","watch":"babel -w src --out-dir . --ignore **/__tests__","test":"jest"},"keywords":["gatsby","gatsby-plugin","toml"],"author":{"name":"Arnau Siches","email":"asiches@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/arnau/gatsby-tranformer-toml.git"},"homepage":"https://github.com/arnau/gatsby-tranformer-toml","peerDependencies":{"gatsby":"^2.0.15"},"dependencies":{"ion-parser":"^0.5.1"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","@babel/runtime":"^7.5.5","babel-jest":"^24.8.0","eslint":"^6.0.0","eslint-plugin-jest":"^22.12.0","jest":"^24.8.0","prettier":"^1.18.2"},"gitHead":"aa7e1db408d20397a1194d957ce3adf86008aa12","bugs":{"url":"https://github.com/arnau/gatsby-tranformer-toml/issues"},"_id":"@arnau/gatsby-transformer-toml@1.0.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7sO4uoipON3AqC/hgmEOw8eYpobXynrzJbIURlTp3DROAENToXnCsR69ye3XfXF0CHlVeylYfE6UiqR623SbeA==","shasum":"37feb3b40a408bacf4f44ff92d0e2ea8cc6bd8ee","tarball":"https://registry.npmjs.org/@arnau/gatsby-transformer-toml/-/gatsby-transformer-toml-1.0.0.tgz","fileCount":12,"unpackedSize":14042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM09FCRA9TVsSAnZWagAAgwUP/Rqht9TZnlvMegUimMsp\nPRkbM7wYcjVpIM918ETT2FD6HWj8cmLnuUUiQbaV6TV7sDcVUS94MVUZGru9\nqhU0uyLYkcBSdrRLYx3CS7onRlKt3tgE5xmiwzWvU2zcP6NinJwdrU2OYh8e\nJmjaP8IAwSJH6vgWzzLP+Kucg1fZh4gHsn74clOX3W3TCYFOtuCU56VY2xeA\nP4EI+mhkD+I74eVDOyV4YE8Zqi7zodFqNuvUp/rC8/9ICF9BwqqicqoMPg1e\nf38tuZpC7XI6iYU3wvNjcHlPgDkARUyMVIJpsyDoZuLh/YgdEWNmIlRDCW8w\nBLm3yXldZF+kuyCGRmmx4C4LgIH6dkxIQx+OyGbPcAqMTf1eAti43v6Uiw+A\nsZWxkHiHVuJbLF+vCcoQUy5p1M8MTL/Hfn8mJGQm27EuTyJDtwy40ws0AERx\n+1J2WRT4mO9xOOWqh9iTIjfc0hSM+GDP0WG1vHyjb7DsF2SlA7yjvtlo+wF1\nucsQrw25eAdBPUY9a2UaTcf1mcTu06GiEXD0H0AVCHh/y8CXEtzVOSsh3EgN\niabXX+X4ysHlRqGp9v20zaSrQ1mKGbKjNvMto34vDJUGxvKzm04HD/Z9iLXn\nGBO/R1113w6f2lSpw7247nWcWamJh1ViBlnMfVgVq3zXqZHxIMZE8/b+v7Ii\nwJUy\r\n=KXyw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6iJcUtHhkLNq2LlrasFltyC2ynz1CpOYJy8p50ZMQDwIgQv40rUhzO9Wv3rDId68tMYFbHQinc6oZxGIWC+8473A="}]},"maintainers":[{"name":"arnau","email":"arnau.siches@gmail.com"}],"_npmUser":{"name":"arnau","email":"arnau.siches@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-transformer-toml_1.0.0_1563643716636_0.9821780839523964"},"_hasShrinkwrap":false},"1.0.1":{"name":"@arnau/gatsby-transformer-toml","version":"1.0.1","description":"Gatsby transformer plugin for toml","main":"index.js","scripts":{"build":"babel src --out-dir . --ignore **/__tests__","prepare":"npm run build","watch":"babel -w src --out-dir . --ignore **/__tests__","test":"jest"},"keywords":["gatsby","gatsby-plugin","toml"],"author":{"name":"Arnau Siches","email":"asiches@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/arnau/gatsby-tranformer-toml.git"},"homepage":"https://github.com/arnau/gatsby-tranformer-toml","peerDependencies":{"gatsby":"^2.0.15"},"dependencies":{"ion-parser":"^0.5.1"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","@babel/runtime":"^7.5.5","babel-jest":"^24.8.0","eslint":"^6.0.0","eslint-plugin-jest":"^22.12.0","jest":"^24.8.0","prettier":"^1.18.2"},"gitHead":"8500af1effabafa4b2e08c35345e5245dd418f81","bugs":{"url":"https://github.com/arnau/gatsby-tranformer-toml/issues"},"_id":"@arnau/gatsby-transformer-toml@1.0.1","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-NPqf/duJzKdnBUT/8RDsRHCs29utmPJkpljEDnvxgw5s0VNv3xwwDjw20+7njkQroL3Ovw35JS5fzRG43cTH6Q==","shasum":"ce7499d0c23a4701e16ff0a5f728a488a4f6e561","tarball":"https://registry.npmjs.org/@arnau/gatsby-transformer-toml/-/gatsby-transformer-toml-1.0.1.tgz","fileCount":12,"unpackedSize":14063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM2HPCRA9TVsSAnZWagAA5ggP/jj4cgXlWAylzYNkGbWS\nyueuqAeqQGTJBVBiYXvRAppenMqTT46BaTRI2bu/zuOfULb7Ss5MAG0SxNgl\n+YQfFwrwuuOjzv1GibblHL8WEgsiqpn8hfp30AHUUBqDJvuDZA32H31WvvL+\nvqBDN4HU5WoFMqJk+oxMNuTIKLcCcYCXdo68ajZglbd5GWPdKs+q7xoeRb64\nCC+0K4aMBSbErE3HpASR117CgjAxU+vmSpxoJn6jJIgeKi8eWa+I9uO4DvDY\nrL/a+NSxSZAbRXyVy/DoC50AvjNBpWnx0CgEt4lc0rlJ+qeO565DMuhFhSX3\nUWWv7VrIoYbUDn5frR13ZXhKHXZnJR8q08AYtXTBWxw6uoNawraJ0Khg/b+3\n1bUsWn6JlIWSCeK4idr+zcEeAM2lu6ucTpwbFfR4xIIsUvE3TLnubJsY1v7G\nN6IYj1kDGXuhusz54MGcsPDs+Ac5mW3O243GSEWmIewC3yG/159B5qdlUR+1\nFkc8UaFNy8s+e3kYggt0yl2E1YcQCiUMfnWU2lDyJtxqZD3wnjjlDFawK4sh\nfVO6158lADN8MZoTKfeZYtSCDPRiFwN+FPfyRL4DNdbBnDrZpJYLd4q9uy5a\n2WyiXbZnSRhNabLutyve/QUGHHkpKGc9y6fv8UhvOncHW92y40cYA2TTo+/k\nh0UV\r\n=Vweh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvrEOESNdZtiZ1Cfvftw/a8aPsQVqIvxQK+zCqchVQXAiEAoBJ5zcL8sve+WKfZIfeNT1eg+V1GYFy5OxLzz3zj2lI="}]},"maintainers":[{"name":"arnau","email":"arnau.siches@gmail.com"}],"_npmUser":{"name":"arnau","email":"arnau.siches@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-transformer-toml_1.0.1_1563648462386_0.7708918782311731"},"_hasShrinkwrap":false},"1.0.2":{"name":"@arnau/gatsby-transformer-toml","version":"1.0.2","description":"Gatsby transformer plugin for toml","main":"index.js","scripts":{"build":"babel src --out-dir . --ignore **/__tests__","prepare":"npm run build","watch":"babel -w src --out-dir . --ignore **/__tests__","test":"jest"},"keywords":["gatsby","gatsby-plugin","toml"],"author":{"name":"Arnau Siches","email":"asiches@gmail.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/arnau/gatsby-transformer-toml"},"homepage":"https://github.com/arnau/gatsby-transformer-toml","peerDependencies":{"gatsby":"^2.0.15"},"dependencies":{"ion-parser":"^0.5.1"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","@babel/runtime":"^7.5.5","babel-jest":"^24.8.0","eslint":"^6.0.0","eslint-plugin-jest":"^22.12.0","jest":"^24.8.0","prettier":"^1.18.2"},"_id":"@arnau/gatsby-transformer-toml@1.0.2","dist":{"shasum":"b2be68f22d5c9d14b41e3ea51824a3e22e6ecfa6","integrity":"sha512-6lX1XKTzEHRPZRmNM3ANjIOM6F2lFPKYxFC4ubOkpDZ4LJDObLPsJQ4wovqnVA3MaT2Rqfmo+VCMAo6tsHlzpg==","tarball":"https://registry.npmjs.org/@arnau/gatsby-transformer-toml/-/gatsby-transformer-toml-1.0.2.tgz","fileCount":17,"unpackedSize":15292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFC3PCRA9TVsSAnZWagAAw5wP/3Agb9bO4HUDtDjeOEYb\npRWEkIirWyfdTAVusbMPZ83ej2vvsLPj7ZH3lOD06Zf1dSSv8hiYCJlNAmX8\ntlGNCwbEivzSfj0k2GULQ2Jke3dtHFNxpQd2LCkv6jQVr0tueImLweOfJ/v1\nWIBKSlio9dcSIboaLPfHjap/jYpx5eGm/RUUjgpOK2n5uK/dhuF2m19iYKwj\nviR8fBSxlxZlBNrYVoKUqyPfyoARdBTCPuFI8mCOpjNI1O0GxyMTsgWojIea\nFfsjnqcfloCtqPEluUPQNmBj1Ts2uj+mQBoQ5OdlUGDq6DBrrDkLGrbG4+8e\nE63mTenWJv30AUKyHSl9grrrNTB92d2D9qfhIgOKPnp1BWa7HvJW9o9VOh3S\np6BN/NsQmXysPwpIJjV1ncM5++N+RiSLJM52xdpm9cbDdx+rltKKF578/CIl\n+sJNN8fgrKpc5ei9pnp+Bhr8BS9l9ty99Vc9qZj5tE9gZ9UVDWSf5YQhEOfS\n2G1RndBVl/cBoXihQAyrRXolvQPLpW/cAjP2nFWAxS+u/Ax0QHSpZblz36IT\n/zNIZyNywlXDeY5qYUXyQMri/f/HwmFKIPmpuf7rCCkIsk6vE5OOaOwxEs7s\n68fYkq/sOMKlpf1efzR7z/4a0zBmg4Wti4Y6Al64Fz29cdkmWQuhRQdrAXlB\n64DV\r\n=AcT3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbS/ns+R0Lq52sElqHqKnw6KoeDxievci6RyrtTnmDEwIgY3/cTJvztuJIdaRAXmGHG5lZeOhUdGmIz3WOqrL69Mg="}]},"maintainers":[{"name":"arnau","email":"arnau.siches@gmail.com"}],"_npmUser":{"name":"arnau","email":"arnau.siches@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-transformer-toml_1.0.2_1578380750814_0.8467369435330383"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-20T17:28:36.426Z","1.0.0":"2019-07-20T17:28:36.733Z","modified":"2022-04-04T15:33:39.743Z","1.0.1":"2019-07-20T18:47:42.537Z","1.0.2":"2020-01-07T07:05:50.911Z"},"maintainers":[{"name":"arnau","email":"arnau.siches@gmail.com"}],"description":"Gatsby transformer plugin for toml","homepage":"https://github.com/arnau/gatsby-transformer-toml","keywords":["gatsby","gatsby-plugin","toml"],"repository":{"type":"git","url":"https://github.com/arnau/gatsby-transformer-toml"},"author":{"name":"Arnau Siches","email":"asiches@gmail.com"},"license":"MIT","readme":"# gatsby-transformer-toml\n\nUse the latest version of [TOML](https://github.com/toml-lang/toml) in your\nGatsby site and control what [GraphQL](https://graphql.org/) type a file\nshould use.\n\n`gatsby-transformer-toml` is a [Gatsby](https://gatsbyjs.org) plugin to\ntransform [TOML](https://github.com/toml-lang/toml) files into Gatsby nodes.\n\nIt uses [`ion-parser`](https://www.npmjs.com/package/ion-parser) to\nparse TOML files. It's fast, small and has no dependencies.\n\n\n## Problem\n\n[Gatsby's `gatsby-transformer-toml`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-toml)\nworks only form TOML 0.4 and it makes a GraphQL type per file.\n\nIf you find yourself in need of controlling what types should be used for your\nTOML files, this plugin may be a solution for you.\n\n\n## Install\n\n```sh\nyarn add @arnau/gatsby-transformer-toml\n```\n\n\n## Usage\n\n```javascript\n// In your gatsby-config.js\nplugins: ['@arnau/gatsby-transformer-toml']\n```\n\n## Example\n\nLet's say you have a TOML files without a `type` attribute:\n\n```toml\n# settings.toml\n\ndescription = \"My settings outside gatsby-config.js\"\n\n[licence]\nid = \"mit\"\nlabel = \"MIT License\"\nurl = \"https://choosealicense.com/licenses/mit/\"\n\n[[editors]]\nid = \"arnau\"\nname = \"Arnau Siches\"\n```\n\nBy default if no type is provided it uses `TOML` so you can query the above\nlike:\n\n```graphql\nquery {\n  toml {\n    description\n    licence {\n      label\n      url\n    }\n  }\n}\n```\n\nResulting in:\n\n```javascript\n{\n  data: {\n    toml: {\n      description: \"My settings outside gatsby-config.js\",\n      licence: {\n        label: \"MIT License\",\n        url: \"https://choosealicense.com/licenses/mit/\"\n      }\n    }\n  }\n}\n```\n\nIf you have two TOML files with different structures, Gatsby will merge them\nunder the same type. Enter the `type` attribute:\n\n```toml\n# data/tools/gatsby.toml\n\ntype = \"Tool\"\nid = \"gatsby\"\nname = \"Gatsby\"\nurl = \"https://www.gatsbyjs.org/\"\n```\n\n```toml\n# data/tools/netlify.toml\n\ntype = \"Tool\"\nid = \"netlify\"\nname = \"Netlify\"\nurl = \"https://www.netlify.com/\"\n```\n\nThis time we can query specifically all nodes of type `Tool`:\n\n```graphql\nquery {\n  allTool {\n    name\n    url\n  }\n}\n```\n\nResulting in:\n\n```javascript\n{\n  data: {\n    allTool: [\n      {\n        name: \"Gatsby\",\n        url: \"https://www.gatsbyjs.org/\"\n      },\n      {\n        name: \"Netlify\",\n        url: \"https://www.netlify.com/\"\n      },\n    ]\n  }\n}\n```\n\nFinally, if you need to query all nodes generated from TOML files, you can\nrely on the fact that all of them have the internal media type\n`application/toml`:\n\n```javascript\n// gatsby-node.js\n\nexports.onCreateNode = ({ node, actions }) => {\n  if (node.internal.mediaType === 'application/toml') {\n    // do stuff\n  }\n}\n```\n\n## Options\n\n### `defaultType`\n\nThe `defaultType` option allows to override the default type `TOML`. For\nexample:\n\n```javascript\n// gatsby-config.js\n\nplugins: [\n  {\n    resolve: '@arnau/gatsby-transformer-toml',\n    options: {\n      defaultType: 'ION'\n    }\n  }\n]\n```\n\n### `extensions`\n\nThe `extensions` option allows to override the default extension list. For\nexample:\n\n```javascript\n// gatsby-config.js\n\nplugins: [\n  {\n    resolve: '@arnau/gatsby-transformer-toml',\n    options: {\n      defaultType: 'ION',\n      extensions: ['toml', 'ion']\n    }\n  }\n]\n```\n\n\n## Development\n\nThis plugin is fairly trivial, the following should be enough to get you\nstarted:\n\n```sh\nyarn install && yarn test\n```\n\n\n## Licence\n\nLicensed under the [MIT licence](./LICENCE)\n","readmeFilename":"README.md"}