New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

conversikit

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conversikit

convert anything

  • 1.8.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-62.86%
Maintainers
1
Weekly downloads
 
Created
Source

CONVERSIKIT

conversikit is a versatile JavaScript library that provides functions to convert and transform text and data in various ways. Whether you need to change letter casing, convert between JSON and arrays, apply camel case formatting, or handle CSV data, conversikit has you covered.

Functions

toConvertUpperCase(string)

  • Converts all letters in the input string to uppercase.

toConvertLowerCase(string)

  • Converts all letters in the input string to lowercase.

toConvertCapitalizeCase(string)

  • Converts the input string into capitalize case.

toConvertArrayJson(array)

  • Converts an array to JSON format.

toConvertJsonArray(array)

  • Converts JSON data to an array format.

toConvertCamelCase(string)

  • Converts a string into camel case.

toConvertCSVFile(data, fileName)

  • Converts an array of JSON data into a CSV file.

toConvertCSVToJson(path)

  • Converts a CSV file into JSON format.

Examples

const conversikit = require("conversikit");

async function example() {
  const data = await conversikit.toConvertUpperCase("thank you my man"); // "THANK YOU MY MAN"
  const data1 = await conversikit.toConvertLowerCase("thank you my Man"); // "thank you my man"
  const data2 = await conversikit.toConvertCapitalizeCase("thank you my Man"); // "Thank You My Man"

  console.log(data);
  console.log(data1);
  console.log(data2);
}

example();

Convert Array to JSON

const conversikit = require("conversikit");

const data = [
  "name",
  "Ankit",
  "roll",
  "10",
  // ... (other key-value pairs)
];

const jsonData = await conversikit.toConvertArrayJson(data);
console.log("Result =", jsonData);

Output:

Result = {
  name: "Ankit",
  roll: "10",
  // ... (other key-value pairs)
};

Note: If duplicate keys are present in the array, they will be handled gracefully.

Convert String into Camel Case

const conversikit = require("conversikit");

const data = "thank you";
const data1 = "";
const data2 = "thank";
const data3 = "we are programmer";

const result = await conversikit.toConvertCamelCase(data); // "thankYou"
const result1 = await conversikit.toConvertCamelCase(data1); // ""
const result2 = await conversikit.toConvertCamelCase(data2); // "thank"
const result3 = await conversikit.toConvertCamelCase(data3); // "weAreProgrammer"

Convert Array JSON Data to CSV File

const conversikit = require("conversikit");

const data = [
  { name: "test1", age: 10 },
  { name: "test2", age: 30 },
  // ... (other objects)
];

const filename = "example.csv";
await conversikit.toConvertCSVFile(data, filename);

Convert CSV to JSON

const conversikit = require("conversikit");
const data = await conversikit.toConvertCSVToJson("give your file path name"); // e.g., "data.csv"

Output:

Result = [
  { name: 1, age: 10, dob: "12-08-1997" },
  { name: "thank", age: 90, dob: "12-09-1995" },
];

Author

Arun Pradhan.

Other

Feel free to reach out for questions, feedback, or contributions.

THANK YOU FOR USING CONVERSIKIT!

Keywords

FAQs

Package last updated on 25 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc