{"id":42055,"library":"synthdef-json-formatter","title":"synthdef-json-formatter","description":"A zero-dependency Node.js formatter for SuperCollider Synth Definition JSON files. Version 1.0.0 is stable with a single `format()` function that pretty-prints a synthdef object according to the SuperCollider Synth Definition File Format specification. Currently in maintenance mode with no active development. Differentiators: lightweight, no runtime dependencies, purely a pretty-printer for a niche audio file format.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/mohayonao/synthdef-json-formatter","tags":["javascript","synthdef"],"install":[{"cmd":"npm install synthdef-json-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add synthdef-json-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add synthdef-json-formatter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not support ESM imports. Use CommonJS require.","wrong":"import { format } from 'synthdef-json-formatter';","symbol":"format","correct":"const formatter = require('synthdef-json-formatter');\nformatter.format(json)"},{"note":"No default export. The require returns an object with a format method.","wrong":"const format = require('synthdef-json-formatter').default;","symbol":"default","correct":"const formatter = require('synthdef-json-formatter');\nformatter.format(json)"},{"note":"You can destructure format directly, as shown in correct import.","wrong":"const format = require('synthdef-json-formatter');","symbol":"format","correct":"const { format } = require('synthdef-json-formatter');"}],"quickstart":{"code":"const format = require('synthdef-json-formatter').format;\n\nconst synthdef = {\n  name: 'test',\n  consts: [0],\n  paramValues: [0.5, 440],\n  paramIndices: [{ name: 'amp', index: 0, length: 1 }, { name: 'freq', index: 1, length: 1 }],\n  units: [['Control', 1, 0, [], [1, 1]], ['SinOsc', 2, 0, [[0, 1], [-1, 0]], [2]]],\n  variants: [{ name: 'default', values: [0.5, 440] }]\n};\n\nconsole.log(format(synthdef));","lang":"javascript","description":"Formats a synthdef JSON object by calling the format function and printing the result."},"warnings":[{"fix":"Use CommonJS require and only call `.format()`.","message":"The package only exports a single `format` function. Do not expect other exports or TypeScript types.","severity":"gotcha","affected_versions":"=1.0.0"},{"fix":"Consider if formatting is still needed; look for alternatives or maintain your own fork.","message":"Package is in maintenance mode; no updates or bug fixes are expected.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Validate your synthdef JSON against the SuperCollider specification before formatting.","message":"The input JSON must strictly follow the SuperCollider Synth Definition File Format. Invalid structures produce no error and return garbled output.","severity":"gotcha","affected_versions":"=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':18 'accord':33 'activ':48 'audio':63 'current':42 'definit':14,38 'depend':8,54 'develop':49 'differenti':50 'file':16,39,64 'format':24,40,65 'formatt':4,10 'function':25 'javascript':66 'json':3,15 'lightweight':51 'mainten':44 'mode':45 'nich':62 'node.js':9 'object':32 'pretti':28,58 'pretty-print':27,57 'print':29 'printer':59 'pure':55 'runtim':53 'singl':23 'specif':41 'stabl':20 'supercollid':12,36 'synth':13,37 'synthdef':2,31,67 'synthdef-json-formatt':1 'version':17 'zero':7 'zero-depend':6","created_at":"2026-06-04T18:55:24.161798+00:00","updated_at":"2026-06-04T18:55:24.161798+00:00","problems":[{"fix":"Use `const formatter = require('synthdef-json-formatter');`","cause":"Using ES import syntax (import { format } from ...) instead of CommonJS require.","error":"TypeError: formatter.format is not a function"},{"fix":"Run `npm install synthdef-json-formatter` and ensure it's in node_modules.","cause":"Package not installed or incorrect path.","error":"Cannot find module 'synthdef-json-formatter'"},{"fix":"Ensure input is a JavaScript object (parsed JSON), not a string.","cause":"Passing a raw string instead of a parsed object to format().","error":"JSON.parse: unexpected character at line 1 column 1 of the JSON data"}],"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://github.com/mohayonao/synthdef-json-formatter/","github":"https://github.com/mohayonao/synthdef-json-formatter","docs":null,"changelog":null,"pypi":null,"npm":"synthdef-json-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}