Nerdiest Political Manifesto

    snakecase-keys
    TypeScript icon, indicating that this package has built-in type declarations

    5.4.4 • Public • Published

    snakecase-keys tests

    Convert an object's keys to snake case

    Install

    $ npm install --save snakecase-keys
    

    Usage

    var snakecaseKeys = require('snakecase-keys')
    
    snakecaseKeys({fooBar: 'baz'})
    //=> {foo_bar: 'baz'}
    
    snakecaseKeys({'foo-bar': true, nested: {fooBaz: 'bar'}});
    //=> {foo_bar: true, nested: {foo_baz: 'bar'}}

    API

    snakecaseKeys(obj, options) -> object

    obj

    Required
    Type: object

    An object to transform into snake case (keys only).

    options

    Optional
    Type: object

    deep

    Type: boolean
    Default: true

    Enables snake-casing of keys in nested objects.

    exclude

    Type: array[string || regexp]
    Default: []

    An array of strings or regular expressions matching keys that will be excluded from snake-casing.

    Related

    License

    MIT © Ben Drucker

    Install

    npm i snakecase-keys

    DownloadsWeekly Downloads

    293,682

    Version

    5.4.4

    License

    MIT

    Unpacked Size

    6.55 kB

    Total Files

    5

    Last publish

    Collaborators

    • bendrucker