underscore-to-camelcase
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

underscore-to-camelcase

Underscore and camelCase naming styles interchangeable.

Install

npm i underscore-to-camelcase
or
yarn add underscore-to-camelcase

Usage

// convert to camelcase
import convert from "underscore-to-camelcase";
const data = [{ first-name: 1, last-time: '10:10' }]
convert(data, 'camelcase') // [{ firstName: 1, lastTime: '10:10' }]

// convert to underscore
import convert from "underscore-to-camelcase";
const data = [{ firstName: 1, lastTime: '10:10' }]
convert(data, 'underscore') // [{ first-name: 1, last-time: '10:10' }]

// convert a single string
import { formatCamelcase, formatUnderscore } from "underscore-to-camelcase";
formatCamelcase('first-name') // firstName
formatUnderscore('firstName') // first-name

API

Package Sidebar

Install

npm i underscore-to-camelcase

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

11.8 kB

Total Files

11

Last publish

Collaborators

  • bearcookie