Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-router-sitemap-generator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-sitemap-generator

![Master](https://github.com/clh161/react-router-sitemap-generator/actions/workflows/main.yml/badge.svg?branch=master) [![npm package](https://img.shields.io/npm/v/react-router-sitemap-generator.svg?style=flat-square)](https://www.npmjs.org/package/react-

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
405
increased by42.11%
Maintainers
1
Weekly downloads
 
Created
Source

react-router-sitemap-generator

Master npm package npm

Generate sitemap.xml from react-router.

Get started

Install react-router-sitemap-generator

yarn add --dev react-router-sitemap-generator

Add babel

yarn add --dev @babel/node @babel/preset-env @babel/preset-react

Add preset to your babel config file .babelrc

{
  "presets": ["@babel/preset-env", "@babel/preset-react"]
}

Add a sitemap generator file

// sitemap.js

import Generator from 'react-router-sitemap-generator';
import Router from './component/Router'; //import your react router component

const generator = new Generator(
  'https://react-router-sitemap-generator.com',
  Router(),
  {
    lastmod: new Date().toISOString().slice(0, 10),
    changefreq: 'monthly',
    priority: 0.8,
  }
);
generator.save('public/sitemap.xml');

Run generator file

yarb run babel-node sitemap.js

Roadmap

  • Support nested routes

FAQs

Package last updated on 09 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc