url-to-page-title

0.0.0 • Public • Published

url-to-page-title

Turn URLs into page title friendly strings

Depending on your URL structure, you might want to use it to dynamically set the page title: "/react-router/web/api/Route/route-props""React Router - Web - Api - Route - Route Props"

Install

$ npm install url-to-page-title

Usage

const urlToPageTitle = require('url-to-page-title');
 
// window.location.pathname is: "/react-router/web/api/Route/route-props"
const pageTitle = urlToPageTitle(window.location.pathname); // "React Router - Web - Api - Route - Route Props"
document.title = pageTitle;

License

MIT © Carl Mungazi

/url-to-page-title/

    Package Sidebar

    Install

    npm i url-to-page-title

    Weekly Downloads

    1

    Version

    0.0.0

    License

    MIT

    Unpacked Size

    3.12 kB

    Total Files

    5

    Last publish

    Collaborators

    • carlmungazi