1.3.0 • Published 2 years ago

name-transform v1.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

name-transform

A tiny library for transforming names.

Features

  • Tiny size
  • Typescript support
  • umd and cjs

Usage

/*
  camel       -->  'helloWorld'
  pascal      -->  'HelloWorld'
  hyphen      -->  'hello-world'
  underscore  -->  'hello_world'
 */
import {
  camelToHyphen,
  camelToPascal,
  camelToUnderscore,
  pascalToCamel,
  pascalToHyphen,
  pascalToUnderscore,
  underscoreToCamel,
  underscoreToHyphen,
  underscoreToPascal,
} from 'name-transform'

camelToUnderscore('helloWorld')     // =>'hello_world'
camelToPascal('helloWorld')         // =>'HelloWorld'
camelToHyphen('helloWorld')         // =>'hello-world'
pascalToCamel('HelloWorld')         // =>'helloWorld'
pascalToHyphen('HelloWorld')        // =>'hello-world'
pascalToUnderscore('HelloWorld')    // =>'hello_world'
underscoreToCamel('hello_world')    // =>'helloWorld'
underscoreToPascal('hello_world')   // =>'HelloWorld'
underscoreToHyphen('hello_world')   // =>'hello-world'
1.3.0

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago