New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

camelcasejs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

camelcasejs

String to CamelCase or CamelCase to string: `foo-bar` ⇄ `fooBar`

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

CamelCase JS

String to CamelCase or CamelCase to string: foo-barfooBar

Install

$ npm install --save camelcasejs

Methods

  • CamelCase
    • Convert string/array to CamelCase format
  • DeCamelize
    • Convert CamelCase format to string

Examples

CamelCase

// Import
const { CamelCase } = require('camelcasejs');

CamelCase('foo-bar');
// Response = 'fooBar'

CamelCase('foo_bar');
// Response = 'fooBar'

CamelCase('Foo-Bar');
// Response = 'fooBar'

CamelCase('--foo.bar');
// Response = 'fooBar'

CamelCase('__foo__bar__');
// Response = 'fooBar'

CamelCase('foo bar');
// Response = 'fooBar'
Array
// Import
const { CamelCase } = require('camelcasejs');

CamelCase(['foo', 'bar']);
// Response = 'fooBar'

DeCamelize

// Import
const { DeCamelize } = require('camelcasejs');

DeCamelize('fooBar');
// Response = 'foo_bar'

DeCamelize('fooBarV9_2');
// Response = 'foo_bar_v9.2'

/* Custom separator */
DeCamelize('fooBar', '=');
// Response = 'foo=bar'

DeCamelize('fooBarV9_2', '-');
// Response = 'foo-bar-v9.2'

License

MIT © Julio Sansossio

Keywords

FAQs

Package last updated on 21 Mar 2018

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