{"id":26032,"library":"oc-template-jade-compiler","title":"OC Jade Template Compiler","description":"Compiler module for OC (OpenComponents) that compiles Jade/Pug templates used by oc-template-jade components. Version 7.5.0 is the latest stable release with intermittent updates. Key differentiators: provides legacy support for both .jade and .pug files; part of the OC micro-frontends ecosystem; ships TypeScript types for safer integration. Known for version mismatches with OC core and template runtime packages.","status":"active","version":"7.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/opencomponents/base-templates","tags":["javascript","oc","opencomponents","typescript"],"install":[{"cmd":"npm install oc-template-jade-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add oc-template-jade-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add oc-template-jade-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for compiling Jade/Pug templates into HTML","package":"pug","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require will fail. Named export compile is the primary API.","wrong":"const compile = require('oc-template-jade-compiler')","symbol":"compile","correct":"import { compile } from 'oc-template-jade-compiler'"},{"note":"TypeScript users can import the class type. Actual usage often uses the compile function directly.","wrong":"","symbol":"JadeCompiler","correct":"import { JadeCompiler } from 'oc-template-jade-compiler'"},{"note":"Default export exists but is not documented; prefer named exports.","wrong":"import { default as ocTemplateJadeCompiler } from 'oc-template-jade-compiler'","symbol":"default","correct":"import ocTemplateJadeCompiler from 'oc-template-jade-compiler'"}],"quickstart":{"code":"import { compile } from 'oc-template-jade-compiler';\nconst template = 'h1 Hello #{name}';\nconst rendered = compile(template)({ name: 'World' });\nconsole.log(rendered); // '<h1>Hello World</h1>'","lang":"typescript","description":"Compiles a Jade/Pug template string with locals and logs the rendered HTML."},"warnings":[{"fix":"Upgrade templates to .pug extension or configure legacy support.","message":"v7.0.0 dropped support for .jade extension by default; only .pug is compiled unless legacy mode enabled.","severity":"breaking","affected_versions":">=7.0.0 <8.0.0"},{"fix":"Use compile(template)(locals) instead of compile(template, options, callback).","message":"compile function with callback signature is deprecated in favor of sync compile returning a function.","severity":"deprecated","affected_versions":">=7.0.0 <8.0.0"},{"fix":"Always pass { filename: String } in options even if empty.","message":"TypeScript types may be out of sync with actual exports; compile expects options object with 'filename' required for includes.","severity":"gotcha","affected_versions":">=7.0.0"}],"env_vars":null,"search_vec":"'7.5.0':22 'compil':4,5,11 'compon':20 'core':62 'differenti':32 'ecosystem':49 'file':41 'frontend':48 'integr':55 'intermitt':29 'jade':2,19,38 'jade/pug':12 'javascript':67 'key':31 'known':56 'latest':25 'legaci':34 'micro':47 'micro-frontend':46 'mismatch':59 'modul':6 'oc':1,8,17,45,61,68 'oc-template-jad':16 'opencompon':9,69 'packag':66 'part':42 'provid':33 'pug':40 'releas':27 'runtim':65 'safer':54 'ship':50 'stabl':26 'support':35 'templat':3,13,18,64 'type':52 'typescript':51,70 'updat':30 'use':14 'version':21,58","created_at":"2026-05-01T13:47:51.056055+00:00","updated_at":"2026-05-01T13:47:51.056055+00:00","problems":[{"fix":"Install pug: npm install pug","cause":"Missing pug peer dependency.","error":"Cannot find module 'pug'"},{"fix":"Use named import: import { compile } from 'oc-template-jade-compiler'","cause":"Incorrect import – likely using default export instead of named export.","error":"TypeError: compile is not a function"},{"fix":"Provide options object with filename: compile(template, { filename: '/path/to/template.jade' })","cause":"The compile function requires a 'filename' option to resolve includes.","error":"ENOENT: no such file or directory, open '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"oc","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/opencomponents/base-templates","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/oc-template-jade-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","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}}