Neutralize Pesky Miscreants

    case-formatter
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.2 • Public • Published

    case-formatter-js

    Simple converters from case to case for string and Record. It can canvert below cases each other.

    • camel
    • snake
    • kebab
    • pascal

    Usage

    import caseFormatter from 'case-formatter';
    
    caseFormatter.snakeToCamel('sample_text');
    // => sampleText: string
    caseFormatter.snakeToCamel({ sample_text: 123 });
    // => { sampleText: 123 }: Record<string, unknown>
    caseFormatter.snakeToCamel<{sampleText: number}>({ sample_text: 123 });
    // => { sampleText: 123 }: {sampleText: number}
    

    Formatters

    • camelToSnake
    • camelToPascal
    • camelToKebab
    • snakeToCamel
    • snakeToPascal
    • snakeToKebab
    • pascalToCamel
    • pascalToSnake
    • pascalToKebab
    • kebabToCamel
    • kebabToSnake
    • kebabToPascal

    Install

    npm i case-formatter

    DownloadsWeekly Downloads

    99

    Version

    1.1.2

    License

    ISC

    Unpacked Size

    6.47 kB

    Total Files

    6

    Last publish

    Collaborators

    • 6bou