1.1.1 • Published 3 years ago

naming-conventions v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

JavaScript naming conventions conversion

JavaScript NamingConventions class which allows one to easily convert strings between namingConventions.

Prerequisites

None :).

Installation

yarn add naming-conventions

Features

Four different naming conventions are available:

  • camelCase
  • PascalCase
  • snake_case
  • kebab-case

Convert string from given convention to another

NamingConventions.convert('someString')
    .from(NamingConventions.camelCase)
    .to(NamingConventions.kebabCase) // 'some-string'

Convert a string with an unknown convention

You can omit the '.from' part in conversion. That causes the input string to be parsed and auto converted to desired target convention. You should prefer to provide the input convention as this method is much more performant.

NamingConventions.convert('someString')
    .to(NamingConventions.kebabCase) // 'some-string'

Extending

You can add more conventions by using the NamingConventions.addConvention method.

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago