Installations
npm install titlecase
Score
98.2
Supply Chain
91.9
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
11.10.1
NPM Version
6.7.0
Statistics
31 Stars
29 Commits
7 Forks
4 Watching
1 Branches
1 Contributors
Updated on 25 Aug 2023
Languages
JavaScript (78.79%)
HTML (21.21%)
Total Downloads
Cumulative downloads
Total Downloads
8,810,814
Last day
-18.8%
3,780
Compared to previous day
Last week
-9.4%
24,982
Compared to previous week
Last month
3.5%
113,862
Compared to previous month
Last year
15.8%
1,320,146
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
David Gouch's String#toTitleCase() for Node.js
This is a fork of David Gouch's excellent String#toTitleCase()
method inspired by John Gruber's post on the topic
I've simply taken it off the String
prototype and exported it from a simple module.
1var toTitleCase = require('titlecase') 2 3console.log(toTitleCase('foo bar baz'))
See Gouch's page with inline converter. Also see this excellent table of test case results for different converters.
In addition, I've added a more comprehensive list of words to not capitalise that includes articles, prepositions and conjunctions (see source files for lists), I'm calling this "lax title case", use it like so:
1var toLaxTitleCase = require('titlecase').toLaxTitleCase 2 3console.log(toLaxTitleCase('foo bar baz'))
Using as an executable
Install with npm install titlecase -g
and you'll get a to-title-case
executable that you can run to titlecase strings:
$ to-title-case "what is this thing?"
What Is This Thing?
Original README:
To Title Case for JavaScript
Instructions: Include the to-title-case.js script and use the new .toTitleCase() method on the string you want converted.
History
2.1 / 2013-11-03
- Acknowledge characters outside of US-ASCII
- Fix bug related to hyphenated small words
- Replace baby's first testing script with the QUnit framework
2.0.1 / 2012-01-06
- Fixed IE 7 breakage introduced in 2.0. Don't treat strings like character arrays.
2.0 / 2012-01-06
- 15% less code and 35% easier to understand.
- Small words list moved to variable for easy modification.
- Test titles rewritten to focus on a single issue per title.
- More braces to make style guides and JSLint happier.
License
Copyright © 2008–2013 David Gouch. Licensed under the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENCE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENCE.md:0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More