{"id":26608,"library":"vmf-transpiler","title":"VMF Transpiler","description":"VMF Transpiler is a library for converting between Valve Map Format (VMF) used by the Hammer editor and JSON. Version 1.0.0, based on leops/vmfparser. It provides parse() and compile() functions for bidirectional conversion, with support for VMF-specific features like multiple values per key (converted to arrays). It is a lightweight utility for game development tooling involving Source Engine maps. Currently stable but single-version release with no published updates.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/birjolaxew/vmf-transpiler","tags":["javascript","vmf","transpiler","parser","valve","source-engine","hammer"],"install":[{"cmd":"npm install vmf-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add vmf-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add vmf-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM module; named exports only.","wrong":"const vmf = require('vmf-transpiler'); vmf.parse()","symbol":"parse","correct":"import { parse } from 'vmf-transpiler'"},{"note":"No default export; only named exports.","wrong":"import vmf from 'vmf-transpiler'; vmf.compile()","symbol":"compile","correct":"import { compile } from 'vmf-transpiler'"},{"note":"For CommonJS, use dynamic import() or use ESM.","wrong":"const vmf = require('vmf-transpiler')","symbol":"whole module","correct":"import * as vmf from 'vmf-transpiler'"}],"quickstart":{"code":"import { parse, compile } from 'vmf-transpiler';\n\n// Example VMF string\nconst vmfSource = `\"entity\"\n{\n  \"id\" \"1\"\n  \"classname\" \"info_player_start\"\n  \"origin\" \"0 0 0\"\n}`;\n\n// Parse VMF to JSON\nconst json = parse(vmfSource);\nconsole.log(json);\n// Output: { entity: { id: '1', classname: 'info_player_start', origin: '0 0 0' } }\n\n// Compile JSON back to VMF\nconst vmfOutput = compile(json);\nconsole.log(vmfOutput);\n// Output: \"entity\"\\n{\\n\\t\"id\" \"1\"\\n\\t\"classname\" \"info_player_start\"\\n\\t\"origin\" \"0 0 0\"\\n}","lang":"typescript","description":"Shows importing parse and compile, converting a VMF string to a JSON object, and back to VMF string."},"warnings":[{"fix":"Handle output values that can be strings or arrays; check Array.isArray().","message":"Duplicate keys in VMF become arrays in JSON, which may be unexpected.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use ast: true option to get an AST if order matters.","message":"The parse method does not preserve key order beyond what JavaScript objects support.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Write ambient declarations or use @ts-ignore.","message":"No TypeScript types shipped; module does not include type definitions.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':23 'array':50 'base':24 'bidirect':34 'compil':31 'convers':35 'convert':9,48 'current':64 'develop':58 'editor':19 'engin':62,82 'featur':42 'format':13 'function':32 'game':57 'hammer':18,83 'involv':60 'javascript':75 'json':21 'key':47 'leops/vmfparser':26 'librari':7 'lightweight':54 'like':43 'map':12,63 'multipl':44 'pars':29 'parser':78 'per':46 'provid':28 'publish':73 'releas':70 'singl':68 'single-vers':67 'sourc':61,81 'source-engin':80 'specif':41 'stabl':65 'support':37 'tool':59 'transpil':2,4,77 'updat':74 'use':15 'util':55 'valu':45 'valv':11,79 'version':22,69 'vmf':1,3,14,40,76 'vmf-specif':39","created_at":"2026-05-01T13:50:51.832225+00:00","updated_at":"2026-05-01T13:50:51.832225+00:00","problems":[{"fix":"Use import { parse } from 'vmf-transpiler' instead of import parse from 'vmf-transpiler'.","cause":"Using default import instead of named import.","error":"TypeError: vmf_transpiler_1.parse is not a function"},{"fix":"Run npm install vmf-transpiler, or check that the package name is correct.","cause":"Module not installed or not in node_modules.","error":"Cannot find module 'vmf-transpiler'"},{"fix":"Ensure input to parse() is VMF format, not JSON.","cause":"Passing a JSON string to parse instead of VMF string.","error":"SyntaxError: Unexpected token ':' in JSON at position ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/birjolaxew/vmf-transpiler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vmf-transpiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"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}}