Skip to content

hebertcisco/json-pascal-case

Repository files navigation

:package: json-pascal-case

📦 json-pascal-case

A simple JSON parser that converts keys to pascal case

Issues GitHub pull requests GitHub Downloads GitHub Total Downloads GitHub release

Report Bug Request Feature

Systems on which it has been tested:

Macos Ubuntu Windows

Did you like the project? Please, considerate a donation to help improve!

A simple JSON parser that converts keys to pascal case

Getting started

codecov

Node.js build and publish package

Installation

Install with yarn or npm: yarn or npm:

# yarn
yarn add json-pascal-case
# npm
npm i json-pascal-case --save

Import the lib with es6 or cjs

// es6
import jsonPascalCase from 'json-pascal-case';
// cjs
const jsonPascalCase = require('json-pascal-case');

Usage examples

transformArrayOfObjects

#!/usr/bin/env node
import jsonPascalCase from 'json-pascal-case';

const array_of_objects = [
    {
        test: 'test',
        test2: 'test2',
    },
    {
        test: 'test',
        test2: 'test2',
    },
];

const result = jsonPascalCase.transformArrayOfObjects(array_of_objects);

console.log(result);

transformObject

#!/usr/bin/env node
import jsonPascalCase from 'json-pascal-case';

const my_object = {
    test: 'test',
    test2: 'test2',
};

const result = jsonPascalCase.transformObject(my_object);

console.log(result);

transformString

#!/usr/bin/env node
import jsonPascalCase from 'json-pascal-case';

const my_string = "my text in lower case";

const result = jsonPascalCase.transformString(my_string);

console.log(result);

transformArrayOfStrings

#!/usr/bin/env node
import jsonPascalCase from 'json-pascal-case';

const my_strings = ["text1", "text2"];

const result = jsonPascalCase.transformArrayOfStrings(my_strings);

console.log(result);

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Or buy me a coffee 🙌🏾

📝 License

Copyright © 2022 Hebert F Barros.
This project is MIT licensed.