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

font-case-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

font-case-parser

Convert font cases

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Font Case

Library to convert string font cases.

Converts a string between Sentense case, camelCase, kebab-case and snake_case, also have some useful string features.

Usage


Basic Conversion

Import any conversion method from font-case package.

import { toKebabCase } from 'font-case';

const someString = 'some text to convert';

const convertedString = toKebabCase(someString);
// some-text-to-convert

Chaining Conversion Methods

You can chain any conversion method using font-case default function, getting converted value with value() method.

By doing so, you can convert any font case to another directly or create another font case as below.

import fontCase from 'font-case';

const someString = 'some text to convert';

const pascalCase =
    fontCase(someString)
        .toCamelCase()
        .capitalize()
        .value();

// SomeTextToConvert

const anotherString = 'some-text-to-convert';

const snakeCase =
    fontCase(someString)
        .toSnakeCase()
        .value();

// some_text_to_convert

API Reference

MethodDescription
toCamelCase()spaced text to lower camelCase
fromCamelCase()camelCase to spaced text
toKebabCase()spaced text to kebab-case
fromKebabCase()kebab-case to spaced text
toSnakeCase()spaced text to snake_case
fromSnakeCase()snake_case to spaced text
capitalize()Capitalize first letter

FAQs

Package last updated on 27 Oct 2017

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