Socket
Socket
Sign inDemoInstall

lodash.snakecase

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.snakecase

The lodash method `_.snakeCase` exported as a module.


Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created

What is lodash.snakecase?

The lodash.snakecase npm package is a utility function that converts a given string to snake_case, where each word is lowercased and separated by an underscore character. It is part of the Lodash library, which is a popular JavaScript utility library for working with arrays, numbers, objects, strings, etc.

What are lodash.snakecase's main functionalities?

String Conversion to snake_case

Converts a string with spaces, camelCase, or PascalCase to snake_case.

_.snakeCase('Foo Bar'); // => 'foo_bar'

Handling Special Characters

Converts a string with dashes or other non-alphanumeric characters to snake_case, removing the special characters.

_.snakeCase('foo-bar'); // => 'foo_bar'

Accommodating Mixed Cases and Numbers

Handles strings with a mix of cases and numbers, ensuring numbers are preserved in the conversion.

_.snakeCase('fooBar2023'); // => 'foo_bar2023'

Other packages similar to lodash.snakecase

Keywords

FAQs

Package last updated on 13 Aug 2016

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc