{"id":17932457,"url":"https://github.com/cheap-glitch/planisphere","last_synced_at":"2025-03-24T05:32:26.677Z","repository":{"id":57325547,"uuid":"325287731","full_name":"cheap-glitch/planisphere","owner":"cheap-glitch","description":"🗺️ A straightforward sitemap generator written in TypeScript.","archived":false,"fork":false,"pushed_at":"2022-03-30T14:35:28.000Z","size":458,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T11:58:02.485Z","etag":null,"topics":["node-module","sitemap","sitemap-builder","sitemap-generator","sitemap-xml","typescript-module"],"latest_commit_sha":null,"homepage":"https://npm.im/planisphere","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheap-glitch.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":"2020-12-29T12:59:16.000Z","updated_at":"2023-09-08T18:16:31.000Z","dependencies_parsed_at":"2022-09-09T05:53:29.403Z","dependency_job_id":null,"html_url":"https://github.com/cheap-glitch/planisphere","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fplanisphere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fplanisphere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fplanisphere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fplanisphere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheap-glitch","download_url":"https://codeload.github.com/cheap-glitch/planisphere/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217130,"owners_count":20579288,"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":["node-module","sitemap","sitemap-builder","sitemap-generator","sitemap-xml","typescript-module"],"created_at":"2024-10-28T21:27:23.493Z","updated_at":"2025-03-24T05:32:26.383Z","avatar_url":"https://github.com/cheap-glitch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗺️ planisphere\n\n[![License](https://shields.io/github/license/cheap-glitch/planisphere)](LICENSE)\n[![Latest release](https://shields.io/github/v/release/cheap-glitch/planisphere?sort=semver\u0026label=latest%20release\u0026color=green)](https://github.com/cheap-glitch/planisphere/releases/latest)\n[![Coverage status](https://shields.io/coveralls/github/cheap-glitch/planisphere)](https://coveralls.io/github/cheap-glitch/planisphere)\n\n\u003e A straightforward sitemap generator written in TypeScript.\n\n## Features\n\n * Generates sitemaps with [associated metadata](https://www.sitemaps.org/protocol.html#xmlTagDefinitions) for each URL\n * Escapes problematic URLs and can append/remove trailing slashes\n * Automatically splits large sitemaps (with 50,000+ URLs) and generates the associated index\n\n## Installation\n\n```\nnpm i planisphere\n```\n\n## Usage\n\n```javascript\nconst { writeSitemaps } = require('planisphere');\n\nwriteSitemaps('dist', [\n\t'/',\n\t'/about',\n\t{\n\t\tloc: '/blog',\n\t\tpriority: 0.9,\n\t\tchangefreq: 'weekly',\n\t},\n], {\n\tbaseUrl: 'https://example.com',\n\ttrailingSlash: false,\n\tpretty: true,\n})\n.then(() =\u003e {\n\tconsole.info('Successfully generated sitemap');\n});\n```\n\n## API\n\n### generateSitemaps(urls: Array\u003cstring | SitemapUrl\u003e, options?): Array\u003cstring\u003e\n\nReturns an  array of  sitemaps contents.\n\nUsually   there   will   only   be   a    single   one,   but   if   more   than\n50,000  URLs   are  provided,   they  will  be   split  into   several  sitemaps\n[as requested  by  the protocol](https://www.sitemaps.org/protocol.html#index).\nYou should  then pass  the resulting  array to  `generateSitemapsIndex()`.\n\n#### `urls`\n\nAn array of strings and/or objects with the following properties:\n\n * `loc: string`: the URL (_required_)\n\n * `lastmod: Date | number | string`: a date string in the [W3C format](https://www.w3.org/TR/NOTE-datetime), a JavaScript timestamp string, a numeric timestamp or a Date object\n\n * `changefreq: SitemapUrlChangefreq`: `'always'`, `'hourly'`, `'daily'`, `'weekly'`, `'monthly'`, `'yearly'` or `'never'`\n\n * `priority: number | string`: a multiple of `0.1` between `0.0` and `1.0` (defaults to `0.5`)\n\n\u003e For more information on those meta tags, you can consult the [official specification](https://www.sitemaps.org/protocol.html#xmlTagDefinitions).\n\n#### `options`\n\nAn object with the following properties (all optional):\n\n * `defaults: { lastmod?, changefreq?, priority? }`: default values for the meta tags accompanying each URL\n\n * `baseUrl: string`: a base URL to prepend every URL with\n\n * `trailingSlash: boolean`: `true` to append a trailing slash to every URL, `false` to always remove it (if unspecified, will leave the URLs unchanged)\n\n * `pretty: boolean`: `true` to pretty-print the outputted XML to be human-readable\n\n### generateSitemapsIndex(files: Array\u003cstring\u003e, options?, lastmod?): string?\n\nReturns the contents of a [sitemap index](https://www.sitemaps.org/protocol.html#index), or `undefined` if there is one filename or less.\n\n#### `files`\n\nThe filenames of the sitemap(s).\n\n#### `lastmod`\n\nThe last modification date of the sitemaps (defaults to the current timestamp).\n\n### writeSitemaps(dest: string, urls: Array\u003cstring | SitemapUrl\u003e, options?)\n\nGenerates and write the sitemap(s) to the disk. Returns a `Promise\u003cvoid\u003e`.\n\n#### `dest`\n\nThe path to the folder in which to write the generated file(s).\n\n## Changelog\n\nSee the full changelog [here](https://github.com/cheap-glitch/planisphere/releases).\n\n## Contributing\n\nContributions are welcomed! Please open an issue before proposing any significant changes.\n\n## Related\n\n * [`vue-cli-plugin-sitemap`](https://github.com/cheap-glitch/vue-cli-plugin-sitemap) – This module as a Vue CLI plugin\n * [`sitempap.js`](https://github.com/ekalinin/sitemap.js) – Another sitemap generator (TypeScript)\n * [www.sitemaps.org](https://www.sitemaps.org/protocol.html) – Detailed description of the Sitemaps protocol\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheap-glitch%2Fplanisphere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheap-glitch%2Fplanisphere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheap-glitch%2Fplanisphere/lists"}