
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
sponge-case
Advanced tools
The sponge-case npm package is a utility that allows users to convert strings to 'sponge case', a style of text where letters alternate between uppercase and lowercase, often used to convey a mocking tone in internet culture. This package provides a simple and efficient way to apply this transformation to any given string.
Convert string to sponge case
This feature allows users to convert a normal string into sponge case. It alternates the casing of each letter in the string, starting with lowercase.
const spongeCase = require('sponge-case');
console.log(spongeCase('hello world')); // Outputs: 'hElLo wOrLd'
Similar to sponge-case, mockingcase also converts strings to the mocking sponge case. It offers additional options such as random casing, which can provide a more varied and less predictable pattern compared to the consistent alternation of sponge-case.
Transform into a string with random capitalization applied.
npm install sponge-case --save
import { spongeCase } from "sponge-case";
spongeCase("string"); //=> "sTrinG"
spongeCase("dot.case"); //=> "dOt.caSE"
spongeCase("PascalCase"); //=> "pASCaLCasE"
spongeCase("version 1.2.10"); //=> "VErSIoN 1.2.10"
This package is a pure ESM package and ships with TypeScript definitions. It cannot be require
'd or used with CommonJS module resolution in TypeScript.
MIT
FAQs
Transform into a string with random capitalization applied
The npm package sponge-case receives a total of 2,953,205 weekly downloads. As such, sponge-case popularity was classified as popular.
We found that sponge-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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.