natural-language-formatter

1.0.0 • Public • Published

Natural Language Formatter

A simple Node.js package to format JSON, numbers, dates, and lists in a natural language.

Installation

npm install natural-language-formatter

npm install github:jithubaiju55/natural-language-formatter

usage

const { formatJSON } = require('natural-language-formatter');

const data = { name: 'Alice', age: 30, hobbies: ['reading', 'travelling'] };
console.log(formatJSON(data));

// Output:
// name: Alice
// age: 30
// hobbies: reading and travelling

const { formatDate } = require('natural-language-formatter');

const date = new Date('2023-01-01');
console.log(formatDate(date));

// Output: January 1, 2023


const { formatList } = require('natural-language-formatter');

const list = ['apples', 'bananas', 'oranges'];
console.log(formatList(list));

// Output: apples, bananas and oranges

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i natural-language-formatter

    Weekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    4.75 kB

    Total Files

    10

    Last publish

    Collaborators

    • jithu_baiju