https://github.com/webdeveric/styled-json-console
Custom Node.js Console that styles your JSON output
https://github.com/webdeveric/styled-json-console
ansi console formatting json logging node nodejs
Last synced: 5 months ago
JSON representation
Custom Node.js Console that styles your JSON output
- Host: GitHub
- URL: https://github.com/webdeveric/styled-json-console
- Owner: webdeveric
- License: mit
- Created: 2025-12-23T22:14:05.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-12-27T20:29:38.000Z (5 months ago)
- Last Synced: 2025-12-28T17:58:08.671Z (5 months ago)
- Topics: ansi, console, formatting, json, logging, node, nodejs
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/styled-json-console
- Size: 275 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# `styled-json-console`
Create a custom Node.js [`Console`](https://nodejs.org/api/console.html#new-consoleoptions) that automatically adds colors to [`JSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) strings.
## Install
```shell
pnpm add styled-json-console
```
## Usage
```ts
import { createConsole } from 'styled-json-console';
const myConsole = createConsole({
// Options go here
});
myConsole.log(
JSON.stringify({
message: 'Hello, World!',
now: Date.now(),
}),
);
```
### [Example](./example/index.ts)
Checkout this repo then run this:
```sh
pnpm install
pnpm build
node ./example/index.ts
```