What is dot-case?
The dot-case npm package is used to convert strings into dot case, where each word or abbreviation in the string is separated by a dot (period). This is often used for creating names that are consistent with certain coding conventions or configurations where dot notation is preferred.
What are dot-case's main functionalities?
Convert string to dot case
This feature takes a string and converts it to dot case. For example, 'hello world' would be converted to 'hello.world'.
"hello world".split(' ').join('.');
Other packages similar to dot-case
snake-case
The snake-case package converts strings to snake case, where each word is separated by an underscore. It is similar to dot-case but uses underscores instead of dots.
param-case
The param-case package converts strings to param case (also known as kebab case), where each word is separated by a dash. It is similar to dot-case in that it is used for URL slugs and CSS class names, but it uses dashes instead of dots.
camelcase
The camelcase package converts strings to camel case, where the first letter of each word except the first is capitalized and all words are joined without spaces. It differs from dot-case as it is often used in programming for variable and function names.
title-case
The title-case package converts strings to title case, where the first letter of each word is capitalized. It is different from dot-case as it is used for titles and headings rather than coding conventions.
Dot Case
Transform into a lower case string with a period between words.
Installation
npm install dot-case --save
Usage
import { dotCase } from "dot-case";
dotCase("string");
dotCase("dot.case");
dotCase("PascalCase");
dotCase("version 1.2.10");
The function also accepts options
.
License
MIT