Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@directus/format-title
Advanced tools
Custom formatter that converts any string into Title Case
Custom formatter that converts any string into Title Case.
Capital letters are used for principal words. Articles, conjunctions, and prepositions do not get capital letters unless they start or end the title.
Input | Output |
---|---|
snowWhiteAndTheSevenDwarfs | Snow White and the Seven Dwarfs |
NewcastleUponTyne | Newcastle Upon Tyne |
brighton_on_sea | Brighton on Sea |
apple_releases_new_ipad | Apple Releases New iPad |
7-food-trends | 7 Food Trends |
The package contains a list of words that use some sort of special casing, for example: McDonalds, iPhone, and YouTube.
npm install @directus/format-title
The package by default converts camelCase, PascalCase, underscore, and "regular" sentences to Title Case.
formatTitle(string, [separator]);
formatTitle('snowWhiteAndTheSevenDwarfs');
// => Snow White and the Seven Dwarfs
You can provide an optional separator
regex as a second parameter to support splitting the string on different
characters. By default, this regex is set to /\s|-|_/g
.
This package is licensed under the MIT License. See the LICENSE file for more information.
FAQs
Custom formatter that converts any string into Title Case
The npm package @directus/format-title receives a total of 9,467 weekly downloads. As such, @directus/format-title popularity was classified as popular.
We found that @directus/format-title demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
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.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.