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

dashify

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dashify

Convert a camelcase or space-separated string to a dash-separated string. ~12 sloc, fast, supports diacritics.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
535K
increased by0.27%
Maintainers
1
Weekly downloads
 
Created

What is dashify?

The dashify npm package is a utility that converts a string with spaces or camelCase into a dash-separated string. This is particularly useful for creating URL slugs, CSS class names, or other identifiers that require a specific format.

What are dashify's main functionalities?

Convert camelCase to dash-case

This feature allows you to convert a camelCase string into a dash-separated string. This is useful for transforming variable names or other identifiers into a format suitable for URLs or CSS class names.

const dashify = require('dashify');
const result = dashify('camelCaseString');
console.log(result); // Output: camel-case-string

Convert space-separated string to dash-case

This feature allows you to convert a space-separated string into a dash-separated string. This is useful for creating URL slugs or other identifiers from user input or other sources.

const dashify = require('dashify');
const result = dashify('space separated string');
console.log(result); // Output: space-separated-string

Convert mixed case and space-separated string to dash-case

This feature allows you to convert a string that contains both camelCase and spaces into a dash-separated string. This is useful for normalizing various types of input into a consistent format.

const dashify = require('dashify');
const result = dashify('MixedCase and space separated');
console.log(result); // Output: mixed-case-and-space-separated

Other packages similar to dashify

Keywords

FAQs

Package last updated on 20 Nov 2018

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