
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
constant-case
Advanced tools
The constant-case npm package is used to convert strings into constant case format, typically used for defining constants in programming. This format involves converting all letters to uppercase and replacing spaces and other special characters with underscores.
String Conversion to Constant Case
Converts a given string into constant case, making all characters uppercase and replacing spaces and special characters with underscores. Useful for creating identifiers in code that are typically constants.
const constantCase = require('constant-case');
console.log(constantCase('string to convert')); // 'STRING_TO_CONVERT'
A comprehensive toolkit for converting text between different cases. It includes constant-case as one of its many functions, along with other cases like camel case, capital case, and more. This makes change-case more versatile compared to constant-case, which specializes in only constant case conversion.
Converts a string to uppercase. It is similar to constant-case in that it affects the letter casing, but it does not replace spaces or special characters with underscores, thus it's less suitable for creating constant identifiers but useful for general uppercasing needs.
Transform into upper case string with an underscore between words.
npm install constant-case --save
import { constantCase } from "constant-case";
constantCase("string"); //=> "STRING"
constantCase("dot.case"); //=> "DOT_CASE"
constantCase("PascalCase"); //=> "PASCAL_CASE"
constantCase("version 1.2.10"); //=> "VERSION_1_2_10"
The function also accepts options
.
MIT
FAQs
Transform into upper case string with an underscore between words
The npm package constant-case receives a total of 1,407,797 weekly downloads. As such, constant-case popularity was classified as popular.
We found that constant-case demonstrated a not healthy version release cadence and project activity because the last version was released 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.