@bnidev/js-utils
    Preparing search index...

    Function snakeCase

    • Converts a string to snake_case.

      Parameters

      • str: string

        The string to convert.

      Returns string

      The string in snake_case format.

      // ES Module
      import { snakeCase } from '@bnidev/js-utils'

      // CommonJS
      const { snakeCase } = require('@bnidev/js-utils')
      snakeCase('helloWorld') // 'hello_world'
      snakeCase('hello world') // 'hello_world'
      snakeCase('hello-world') // 'hello_world'