Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
hyphenate-style-name
Advanced tools
The hyphenate-style-name package is a small, focused utility designed for converting JavaScript style object keys from camelCase to hyphenated-case. This is particularly useful when working with CSS in JavaScript solutions, where you might need to convert style objects into a format that can be used directly in stylesheets or inline styles.
Hyphenating Style Names
Converts JavaScript style object keys from camelCase (e.g., 'marginLeft') to hyphenated-case (e.g., 'margin-left'). This is useful for dynamically generating CSS styles in JavaScript.
"marginLeft" => "margin-left"
Similar to hyphenate-style-name, camelcase-css converts CSS property names between camelCase and hyphenated-case. While hyphenate-style-name focuses on converting from camelCase to hyphenated-case, camelcase-css offers conversion in both directions, making it a bit more flexible depending on the user's needs.
change-case is a more comprehensive string manipulation library that includes functionality for transforming strings into various cases, including camel case, snake case, kebab case, and more. Compared to hyphenate-style-name, which is specialized for style names, change-case offers a broader range of string manipulation tools, making it suitable for a wider variety of applications beyond just CSS property names.
Hyphenates a camelcased CSS property name. For example:
backgroundColor
=> background-color
MozTransition
=> -moz-transition
msTransition
=> -ms-transition
color
=> color
$ npm install --save hyphenate-style-name
var hyphenateStyleName = require('hyphenate-style-name')
console.log(hyphenateStyleName('MozTransition')) // -moz-transition
BSD-3-Clause licensed. See LICENSE.
FAQs
Hyphenates a camelcased CSS property name
The npm package hyphenate-style-name receives a total of 3,667,764 weekly downloads. As such, hyphenate-style-name popularity was classified as popular.
We found that hyphenate-style-name demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.