{"id":25206,"library":"embark-compiler","title":"embark-compiler","description":"Embark compiler module that abstracts the compiler interface and exposes a plugin API for contract extensions. Current stable version is 6.0.0, part of the Embark framework (release cadence: major versions every 6-12 months, nightly releases). Key differentiators: integrates with Solidity (solc), supports plugin-based compiler registration, and provides a command-driven compilation flow. Compared to alternatives like Truffle Compile, it is tightly coupled with the Embark ecosystem and uses a unique event-based request pattern.","status":"active","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/embarklabs/embark","tags":["javascript","blockchain","dapps","ethereum","ipfs","serverless","solc","solidity","typescript"],"install":[{"cmd":"npm install embark-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add embark-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add embark-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the Embark runtime, events, and plugin system","package":"@embark/core","optional":false}],"imports":[{"note":"File class is part of embark-core, not embark-compiler. ESM import required.","wrong":"const { File } = require('embark-compiler')","symbol":"File","correct":"import { File } from 'embark-core'"},{"note":"This is an event request, not a direct import. Used via the Embark events system.","symbol":"compiler:contracts:compile","correct":"embark.events.request('compiler:contracts:compile', contractFiles, options, callback)"},{"note":"registerCompiler is a plugin API method on the plugins object, not a named export.","wrong":"require('embark-compiler').registerCompiler(...)","symbol":"registerCompiler","correct":"plugins.registerCompiler('extension', callback)"}],"quickstart":{"code":"import { File } from 'embark-core';\nconst contractFiles = [new File({\n  path: 'SimpleStorage.sol',\n  type: 'custom',\n  resolver: (cb) => cb('pragma solidity ^0.5.0; contract SimpleStorage { uint storedData; }')\n})];\nembark.events.request('compiler:contracts:compile', contractFiles, { isCoverage: false }, (err, compiledObject) => {\n  if (err) { console.error(err); return; }\n  console.log('Bytecode:', compiledObject.runtimeBytecode);\n});","lang":"typescript","description":"Compiles a Solidity contract using Embark's event-based request system, showing the minimal setup with a File object."},"warnings":[{"fix":"Upgrade Node to >=10.17.0 and npm to >=6.11.3 or yarn >=1.19.1.","message":"embark-compiler v6.0.0 drops support for Node <10.17.0 and npm <6.11.3.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use the event-based request pattern instead (compiler:contracts:compile).","message":"The old callback-based plugin API (registerCompiler) may be removed in future versions.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Always set type: 'custom' or appropriate value when creating File instances.","message":"File objects must include a 'type' property; omitting it may cause errors.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Pass { isCoverage: false } if not using coverage.","message":"Compilation options parameter is required and must include isCoverage (boolean).","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"search_vec":"'-12':36 '6':35 '6.0.0':24 'abstract':8 'altern':62 'api':16 'base':49,80 'blockchain':84 'cadenc':31 'command':56 'command-driven':55 'compar':60 'compil':3,5,10,50,58,65 'contract':18 'coupl':69 'current':20 'dapp':85 'differenti':41 'driven':57 'ecosystem':73 'embark':2,4,28,72 'embark-compil':1 'ethereum':86 'event':79 'event-bas':78 'everi':34 'expos':13 'extens':19 'flow':59 'framework':29 'integr':42 'interfac':11 'ipf':87 'javascript':83 'key':40 'like':63 'major':32 'modul':6 'month':37 'night':38 'part':25 'pattern':82 'plugin':15,48 'plugin-bas':47 'provid':53 'registr':51 'releas':30,39 'request':81 'serverless':88 'solc':45,89 'solid':44,90 'stabl':21 'support':46 'tight':68 'truffl':64 'typescript':91 'uniqu':77 'use':75 'version':22,33","created_at":"2026-05-01T13:43:33.352281+00:00","updated_at":"2026-05-01T13:43:33.352281+00:00","problems":[{"fix":"Run 'npm install @embark/core' or ensure Embark framework is properly installed.","cause":"embark-core is a peer dependency not automatically installed.","error":"Cannot find module 'embark-core'"},{"fix":"Set path to the contract's original filename, e.g., 'SimpleStorage.sol'.","cause":"File path does not match the contract's actual file path in the resolver.","error":"Error: ContractSimpleStorage.sol not found"},{"fix":"Wrap File in an array: [new File({...})].","cause":"File objects passed in an incorrect format or not an array.","error":"TypeError: contractFiles is not iterable"}],"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":"https://embark.ethereum.org","github":"https://github.com/embarklabs/embark","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/embark-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["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}}