Socket
Socket
Sign inDemoInstall

snake-case

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

snake-case

Transform into a lower case string with underscores between words


Version published
Maintainers
1
Weekly downloads
8,337,623
decreased by-5.69%

Weekly downloads

Package description

What is snake-case?

The snake-case npm package is designed to convert strings into snake case format, where each word is lowercased and separated by underscores. This is particularly useful for formatting identifiers in programming languages that favor snake case conventions, such as Python and Ruby, or for generating keys for data formats like JSON that may require consistent naming conventions.

What are snake-case's main functionalities?

Convert string to snake case

This feature allows you to convert any string into snake case, making it lowercased and separating words with underscores. It's useful for formatting strings to meet certain coding standards or data formats.

"Hello World".toSnakeCase(); // 'hello_world'

Custom locale support

The package supports custom locales, enabling the conversion of strings with locale-specific characters into snake case while preserving those characters appropriately.

"Äpfel und Birnen".toSnakeCase({ locale: 'de' }); // 'äpfel_und_birnen'

Other packages similar to snake-case

Readme

Source

Snake Case

Transform into a lower case string with underscores between words.

Installation

npm install snake-case --save

Usage

import { snakeCase } from "snake-case";

snakeCase("string"); //=> "string"
snakeCase("dot.case"); //=> "dot_case"
snakeCase("PascalCase"); //=> "pascal_case"
snakeCase("version 1.2.10"); //=> "version_1_2_10"

The function also accepts options.

License

MIT

Keywords

FAQs

Last updated on 30 Sep 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc