{"id":26179,"library":"refs-compiler","title":"Refs Compiler","description":"Compiler for YAML, JSON and INI files using path references. Version 2.0.2 is the latest stable release. The library resolves $ref references in configuration files, enabling modular composition of templates. Designed for Node.js 8+ with native Promises and async/await. Key differentiator: supports YAML, JSON, and INI formats with CLI and programmatic API. Active development with security fixes for js-yaml and handlebars dependencies.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/iniva/refs-compiler","tags":["javascript","json","yaml","ini","ref","refs","reference","references","yaml-ref"],"install":[{"cmd":"npm install refs-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add refs-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add refs-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"YAML parsing and dumping","package":"js-yaml","optional":false},{"reason":"INI file parsing","package":"ini","optional":true}],"imports":[{"note":"ESM default export; CommonJS requires .default: const { default: compiler } = require('refs-compiler')","wrong":"const compiler = require('refs-compiler')","symbol":"default","correct":"import compiler from 'refs-compiler'"},{"note":"Default export, not named export since v2","wrong":"import { compiler } from 'refs-compiler'","symbol":"compiler","correct":"import compiler from 'refs-compiler'"},{"note":"CommonJS requires destructuring default; plain require returns the module object","wrong":"const compiler = require('refs-compiler')","symbol":"default (via CommonJS)","correct":"const { default: compiler } = require('refs-compiler')"}],"quickstart":{"code":"import path from 'path';\nimport compiler from 'refs-compiler';\n\nconst inputTemplate = path.resolve('/path/to/template.yaml');\nconst outputFile = path.resolve('/path/to/output.yaml');\n\ntry {\n  const results = await compiler(inputTemplate, outputFile);\n  console.log(`file created in ${results.outputFile}`);\n} catch (error) {\n  console.error(`An error occurred: ${error.message}`);\n}\n","lang":"typescript","description":"Resolves $ref references in a YAML template and writes the compiled output to a file."},"warnings":[{"fix":"Use import compiler from 'refs-compiler' or const { default: compiler } = require('refs-compiler')","message":"ESM-only since v2; CommonJS require must use .default","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Node.js to version 8 or higher","message":"Node.js <8 is not supported","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Use async/await or .then() instead of callbacks","message":"The package uses native Promises; callbacks not supported","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Do not destructure named exports; import the default export","message":"Default export is the compiler function, not an object","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"const { default: compiler } = require('refs-compiler');","cause":"CommonJS require without accessing .default","error":"TypeError: compiler is not a function"},{"fix":"Run npm install refs-compiler --save-dev","cause":"Package not installed or not in node_modules","error":"Cannot find module 'refs-compiler'"},{"fix":"Use CommonJS require with .default or set type: module in package.json","cause":"Using ESM import in a CommonJS environment without transpilation","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}