{"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,"search_vec":"'2.0.2':14 '8':36 'activ':55 'api':54 'async/await':41 'cli':51 'compil':2,3 'composit':30 'configur':26 'depend':66 'design':33 'develop':56 'differenti':43 'enabl':28 'file':9,27 'fix':59 'format':49 'handlebar':65 'ini':8,48,70 'javascript':67 'js':62 'js-yaml':61 'json':6,46,68 'key':42 'latest':17 'librari':21 'modular':29 'nativ':38 'node.js':35 'path':11 'programmat':53 'promis':39 'ref':1,23,71,72,77 'refer':12,24,73,74 'releas':19 'resolv':22 'secur':58 'stabl':18 'support':44 'templat':32 'use':10 'version':13 'yaml':5,45,63,69,76 'yaml-ref':75","created_at":"2026-05-01T13:48:36.048784+00:00","updated_at":"2026-05-01T13:48:36.048784+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"refs-compiler","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/iniva/refs-compiler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/refs-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}