Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
better-title-case
Advanced tools
Convert a string to title case based on the Daring Fireball rules.
Convert a string to title case based on the Daring Fireball rules.
$ npm install --save better-title-case
import titleCase from 'better-title-case';
console.log(titleCase('Nothing to Be Afraid of?'));
// Nothing to Be Afraid Of?
You can configure better-title-case
to add your own excluded words to the default list, or to prevent the use of the default list by passing a config
object as the second parameter.
Type: [string]
Default: []
Additional words to exclude from capitalization.
titleCase('Nothing to be afraid of?', {
excludedWords: ['be']
});
// 'Nothing to be Afraid Of?'
Type: boolean
Default: true
Disable the usage of the default list of excluded words.
titleCase('Nothing to be afraid of?', {
useDefaultExcludedWords: false
});
// 'Nothing To Be Afraid Of?'
Type: boolean
Default: false
Maintain extra whitespace between words. By default, all whitespace between words is collapsed to a single space.
titleCase('Nothing to be afraid of?', {
preserveWhitespace: true
});
// 'Nothing To Be Afraid Of?'
MIT © Brad Dougherty
FAQs
Convert a string to title case based on the Daring Fireball rules.
We found that better-title-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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.