Registry / devops / vkbeautify

vkbeautify

JSON →
library0.99.3jsnpmunverified

vkbeautify is a JavaScript utility for pretty-printing and minifying XML, JSON, SQL, and CSS. The current stable version is 0.99.3, released with no active release cadence (last update years ago). It provides simple functions to beautify or minify each format, making it useful for formatting code snippets or logs. Its key differentiator is supporting multiple data formats (XML, JSON, SQL, CSS) in one small library, but it is largely unmaintained and may not handle edge cases or large files well compared to modern alternatives like prettier or js-beautify.

npm install vkbeautify
INSTALL
IMPORT
SIG · VKBEAUTIFY
V
vkbeautify
devopsjavascriptv0.99.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

vkbeautify
import vkbeautify from 'vkbeautify'
const vkbeautify = require('vkbeautify')
ESM default import works; CJS require() also works but not recommended for modern projects.
xml
vkbeautify.xml('...')
vkbeautify.xml('...', 2)
Second parameter is indent string or pattern; commonly misused as number of spaces.
json
vkbeautify.json('...')
vkbeautify.json(JSON.parse('...'))
Input must be a string (not an object) for correct formatting; returns a string.
sql
vkbeautify.sql('...')
SQL formatting is basic; no advanced keyword alignment.
css
vkbeautify.css('...')
Minimal CSS formatting; does not handle all syntax.

Demonstrates beautifying and minifying XML, JSON, SQL, and CSS strings.

import vkbeautify from 'vkbeautify'; const xml = '<root><child>text</child></root>'; const json = '{"name":"John","age":30}'; const sql = 'SELECT * FROM users WHERE id=1'; const css = 'body { color: red; }'; console.log(vkbeautify.xml(xml)); console.log(vkbeautify.json(json)); console.log(vkbeautify.sql(sql)); console.log(vkbeautify.css(css)); // Minify console.log(vkbeautify.xmlmin(xml)); console.log(vkbeautify.jsonmin(json)); console.log(vkbeautify.sqlmin(sql)); console.log(vkbeautify.cssmin(css));
Debug
Known issues
deprecatedLibrary is unmaintained; last update years ago.
fix
Consider using prettier or js-beautify for modern formatting.
affects: <=0.99.3
gotchaThe second parameter for indent is a string (like ' '), not a number of spaces.
fix
Use '  ' or '\t' instead of a number.
affects: >=0.0.0
gotchaInput must be a string; passing an object or number can cause errors or unexpected output.
fix
Always stringify objects before passing to json() or other functions.
affects: >=0.0.0
gotchaError handling is minimal; invalid XML/JSON may throw unhelpful errors or produce corrupted output.
fix
Validate input before formatting, or wrap in try-catch.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: vkbeautify.json is not a function
Using require() with a default import or incorrect import syntax.
fix
Use import vkbeautify from 'vkbeautify' or const vkbeautify = require('vkbeautify').default
Cannot read property 'replace' of undefined
Passing undefined or non-string value to a formatting function.
fix
Ensure the argument is a string; e.g., vkbeautify.json(JSON.stringify(obj))
vkbeautify is not defined
Missing import or variable name mismatch.
fix
Check import statement and ensure variable name matches (e.g., import vkbeautify from 'vkbeautify').
Upgrade
Version history
0.99.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
vkbeautify — npm install vkbeautify · libregistry