New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-slugify

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slugify

Slugify a React node

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-slugify

Build status

Slugify a React node.

Usage

slugify(node[, options])

  • node String, Number, Fragment, Array of nodes
  • options Object (optional)
    • delimiter String (default is '-')
    • prefix String (default is '')

Examples

import slugify from 'react-slugify';

slugify('something I want to test');
// -> "something-i-want-to-test"

slugify(<span>Yes it works like that too</span>);
// -> "yes-it-works-like-that-too"

slugify(
  <>
    <span>and</span>
    <span>with</span>
    <span>fragments or arrays</span>
  </>
);
// -> "and-with-fragments-or-arrays"

slugify(<h3>Crème brulée receipe</h3>, { delimiter: '_' });
// -> creme_brulee_receipe

slugify(<h3>Crème brulée receipe</h3>, { prefix: 'user-content' });
// -> user-content-creme-brulee-receipe

slugify(<h3>Crème brulée receipe</h3>, {
  delimiter: '_',
  prefix: 'user-content',
});
// -> user-content_creme_brulee_receipe

Keywords

FAQs

Package last updated on 19 Jan 2023

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