
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
json-to-plain-text
Advanced tools
Convert JSON or JavaScript objects into clean, human-readable plain text format.
json-to-plain-text
is a lightweight npm package that converts JSON into a clean, human-readable plain-text.
Think of it as JSON.stringify()
, but prettier, friendlier, and tailored for logs, debugging, and CLI output.
[!NOTE]
From version 2.0.0+, this package outputs plain text only.
If you need colored output, please use version 1.1.4 .
Use json-to-plain-text
when you need:
npm install json-to-plain-text
import { jsonToPlainText } from "json-to-plain-text";
jsonToPlainText(data: unknown, options?: Options): string
data
(required) โ JSON-like input or JavaScript object.options
(optional) โ Customize the formatting.Option | Type | Default | Description |
---|---|---|---|
separator | string | : | Character used between keys and values. |
spacing | boolean | true | Align keys with spacing before colons. |
squareBracketsForArray | boolean | false | Display arrays inside [] . |
doubleQuotesForKeys | boolean | false | Wrap object keys in double quotes. |
doubleQuotesForValues | boolean | false | Wrap string values in double quotes. |
import { jsonToPlainText, Options } from "json-to-plain-text";
const data = {
place_id: "173937105",
osm_type: "way",
lat: "17.861533866867224",
lon: "78.8081441896764",
address: {
city: "Hyderabad",
state: "Telangana",
country: "India",
},
distance: 2,
};
const options: Options = {
separator: ":",
spacing: true,
squareBracketsForArray: false,
doubleQuotesForKeys: false,
doubleQuotesForValues: false,
};
console.log(jsonToPlainText(data, options));
place_id : 173937105
osm_type : way
lat : 17.861533866867224
lon : 78.8081441896764
address :
city : Hyderabad
state : Telangana
country : India
distance : 2
If this project helps you, consider supporting my open-source work:
A huge thanks to all sponsors for supporting my work!
This project is licensed under the MIT License.
[1.2.0] - 2023-12-8
FAQs
Convert JSON or JavaScript objects into clean, human-readable plain text format.
The npm package json-to-plain-text receives a total of 6,652 weekly downloads. As such, json-to-plain-text popularity was classified as popular.
We found that json-to-plain-text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last weekโs supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.