Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@directus/format-title

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@directus/format-title

Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
decreased by-42.55%
Maintainers
3
Weekly downloads
 
Created
Source

format-title

Custom string formatter that converts any string into Title Case

This package converts any string into title case. This means only using capital letters for the principal words. Articles, conjunctions, and prepositions do not get capital letters unless they start the title

inputoutput
snowWhiteAndTheSevenDwarfsSnow White and the Seven Dwarfs
NewcastleUponTyneNewcastle upon Tyne
brighton_on_seaBrighton on Sea

Installation

$ npm install @directus/format-title

Usage

The package by default converts camelCase, PascalCase, underscore, and "regular" scentences 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.

License

MIT License

Copyright (c) 2018 RANGER Studio

Keywords

FAQs

Package last updated on 27 Mar 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc