Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.