
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
capitalizr is a simple JavaScript utility to capitalize the first letter of a string with options for different capitalization styles.
To install capitalizr, use npm:
npm install capitalizr
You can use capitalizr in both plain JavaScript and in React. Here are examples of each.
You can use require() to import capitalizr in Node.js or JavaScript environments that support CommonJS.
const capitalizr = require('capitalizr');
console.log(capitalizr("hello WORLD")); // Default: "Hello world"
console.log(capitalizr("heLLo from me", 1)); // Option 1: "Hello From Me"
console.log(capitalizr("hello from mE. i am a fish.", 2)); // Option 2: "Hello from me. I am a fish."
In a React project, you can use capitalizr with either require() or ES module import syntax.
require() in Reactconst capitalizr = require('capitalizr');
function App() {
const text = "react is cool. i love coding.";
return (
<div>
<h1>{capitalizr(text, 2)}</h1>
</div>
);
}
export default App;
import in Reactimport capitalizr from 'capitalizr';
function App() {
const text = "hello world from react";
return (
<div>
<h1>{capitalizr(text, 1)}</h1>
</div>
);
}
export default App;
capitalizr(str, option = 0)Parameters:
str (string): The input string to capitalize.option (number): The capitalization option (default is 0).
. Returns:
// Default: Capitalizes only the first letter
capitalizr("hello world"); // "Hello world"
// Option 1: Capitalizes the first letter of each word
capitalizr("hello world from react", 1); // "Hello World From React"
// Option 2: Capitalizes the first letter of each sentence
capitalizr("hello world. i am a fish.", 2); // "Hello world. I am a fish."
This project is licensed under the MIT License.
FAQs
A simple Utility to capitalize a string in javascript
We found that capitalizr 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.