{"id":41603,"library":"node-formatter","title":"node-formatter","description":"NodeJS Code Formatter is a lightweight Node.js package for formatting JSON and JavaScript code. Version 0.0.1 is the initial release with basic formatting capabilities. It offers a simple API for beautifying code, but lacks advanced features or customization options compared to established formatters like Prettier. The package has very low adoption and no release cadence.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https+git://github.com/dnvyrn/formatter","tags":["javascript","node","js","json","formatter"],"install":[{"cmd":"npm install node-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add node-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-formatter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only from v0.0.1; no CommonJS support.","wrong":"const format = require('node-formatter').format;","symbol":"format","correct":"import { format } from 'node-formatter';"},{"note":"Default export is the format function; named export also works.","wrong":"const formatter = require('node-formatter');","symbol":"default","correct":"import formatter from 'node-formatter';"},{"note":"Exported as format in v0.0.1; formatCode is not an export.","wrong":null,"symbol":"formatCode","correct":"import { formatCode } from 'node-formatter';"}],"quickstart":{"code":"import { format } from 'node-formatter';\n\nconst code = '{ \"name\": \"John\" }';\nconst formatted = format(code);\nconsole.log(formatted);\n// Expected output:\n// {\n//   \"name\": \"John\"\n// }","lang":"typescript","description":"Demonstrates basic formatting of JSON string using the format function from node-formatter."},"warnings":[{"fix":"Use import syntax or set type: module in package.json.","message":"Package is ESM-only; require() will throw a Module not found error.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Import 'format' instead.","message":"No named export 'formatCode' exists; using it will cause undefined or error.","severity":"breaking","affected_versions":"0.0.1"},{"fix":"Use dynamic import() in CommonJS.","message":"Package does not support CommonJS; cannot be required.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"N/A","message":"No deprecation warnings as version is 0.0.1.","severity":"deprecated","affected_versions":"0.0.1"}],"env_vars":null,"search_vec":"'0.0.1':19 'adopt':54 'advanc':38 'api':32 'basic':25 'beautifi':34 'cadenc':58 'capabl':27 'code':5,17,35 'compar':43 'custom':41 'establish':45 'featur':39 'format':13,26 'formatt':3,6,46,63 'initi':22 'javascript':16,59 'js':61 'json':14,62 'lack':37 'lightweight':9 'like':47 'low':53 'node':2,60 'node-formatt':1 'node.js':10 'nodej':4 'offer':29 'option':42 'packag':11,50 'prettier':48 'releas':23,57 'simpl':31 'version':18","created_at":"2026-06-04T18:53:12.779237+00:00","updated_at":"2026-06-04T18:53:12.779237+00:00","problems":[{"fix":"Add \"type\": \"module\" to package.json or use .mjs extension.","cause":"ESM import used without proper module setup.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Use import or switch to CommonJS with dynamic import: const { format } = await import('node-formatter');","cause":"Using require() in an ESM context.","error":"TypeError: require is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https+git://github.com/dnvyrn/formatter","github":"https+git://github.com/dnvyrn/formatter","docs":null,"changelog":null,"pypi":null,"npm":"node-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}