name-formatter-js

1.2.1 • Public • Published

Name Formatter JS

This library help you to convert formate names of data.

Installation

  npm install name-formatter-js

Usage

Import Function

  import nameFormatter from "name-formatter-js";

Call Function

  nameFormatter({
    data: myData,
    convert: {
        from: "snake_case" ,
        to: "camelCase"
    }
});

Parameters

Parameter Type Values
data All Type Enter your data
convert.from String camelCase or snake_case
convert.to String camelCase or snake_case

Examples

import nameFormatter from 'name-formatter-js';

// test data
const myData = {
    file_type: "image" ,
    list: [
        {
            file_link: "https://example.com"
        }
    ]
};

// call function
nameFormatter({
    data: myData,
    convert: {
        from: "snake_case" ,
        to: "camelCase"
    }
});

// function return:
// {
//    fileType: "image" ,
//    list: [
//        {
//            fileLink: "https://example.com"
//        }
//    ]
// }

Readme

Keywords

Package Sidebar

Install

npm i name-formatter-js

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

4.29 kB

Total Files

8

Last publish

Collaborators

  • mrbadri