{"id":13774510,"url":"https://github.com/n370/rollup-plugin-geojson","last_synced_at":"2025-04-13T16:43:28.479Z","repository":{"id":65491430,"uuid":"370725882","full_name":"n370/rollup-plugin-geojson","owner":"n370","description":"An unofficial Rollup plugin which Converts .geojson files to ES6 modules.","archived":false,"fork":false,"pushed_at":"2022-10-11T21:19:05.000Z","size":99,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-10T21:46:37.741Z","etag":null,"topics":["geojson","plugin","rollup"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rollup-plugin-geojson","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n370.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"n370"}},"created_at":"2021-05-25T14:41:06.000Z","updated_at":"2024-03-25T22:46:16.000Z","dependencies_parsed_at":"2023-01-26T01:31:25.455Z","dependency_job_id":null,"html_url":"https://github.com/n370/rollup-plugin-geojson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n370%2Frollup-plugin-geojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n370%2Frollup-plugin-geojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n370%2Frollup-plugin-geojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n370%2Frollup-plugin-geojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n370","download_url":"https://codeload.github.com/n370/rollup-plugin-geojson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248747465,"owners_count":21155451,"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":["geojson","plugin","rollup"],"created_at":"2024-08-03T17:01:27.416Z","updated_at":"2025-04-13T16:43:28.457Z","avatar_url":"https://github.com/n370.png","language":"JavaScript","funding_links":["https://github.com/sponsors/n370"],"categories":["Plugins"],"sub_categories":["Other File Imports"],"readme":"[npm]: https://img.shields.io/npm/v/rollup-plugin-geojson\n[npm-url]: https://www.npmjs.com/package/rollup-plugin-geojson\n[size]: https://packagephobia.now.sh/badge?p=rollup-plugin-geojson\n[size-url]: https://packagephobia.now.sh/result?p=rollup-plugin-geojson\n\n[![npm][npm]][npm-url]\n[![size][size]][size-url]\n[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)\n\n# rollup-plugin-geojson\n\n🍣 An unofficial Rollup plugin which Converts .geojson files to ES6 modules.\n\n## Requirements\n\nThis plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.\n\n## Install\n\nUsing npm:\n\n```console\nnpm install rollup-plugin-geojson --save-dev\n```\n\n## Usage\n\nCreate a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:\n\n```js\nimport geojson from 'rollup-plugin-geojson';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'output',\n    format: 'cjs'\n  },\n  plugins: [geojson()]\n};\n```\n\nThen call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).\n\nWith an accompanying file `src/index.js`, the local `data.geojson` file would now be importable as seen below:\n\n```js\n// src/index.js\nimport data from './data.geojson';\nconsole.log(`running version ${data.features}`);\n```\n\n## Options\n\n### `compact`\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nIf `true`, instructs the plugin to ignore `indent` and generates the smallest code.\n\n### `exclude`\n\nType: `String` | `Array[...String]`\u003cbr\u003e\nDefault: `null`\n\nA [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.\n\n### `include`\n\nType: `String` | `Array[...String]`\u003cbr\u003e\nDefault: `null`\n\nA [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.\n\n### `indent`\n\nType: `String`\u003cbr\u003e\nDefault: `'\\t'`\n\nSpecifies the indentation for the generated default export.\n\n### `namedExports`\n\nType: `Boolean`\u003cbr\u003e\nDefault: `true`\n\nIf `true`, instructs the plugin to generate a named export for every property of the JSON object.\n\n### `preferConst`\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nIf `true`, instructs the plugin to declare properties as variables, using either `var` or `const`. This pertains to tree-shaking.\n\n## Meta\n\n[CONTRIBUTING](/.github/CONTRIBUTING.md)\n\n[LICENSE (MIT)](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn370%2Frollup-plugin-geojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn370%2Frollup-plugin-geojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn370%2Frollup-plugin-geojson/lists"}