Registry / devops / embark-solidity

embark-solidity

JSON →
library6.0.0jsnpmunverified

Solidity compiler APIs for the Embark framework (v6.0.0, last stable release April 2020, nightly-only since). Provides programmatic access to solc integration including compilation, version management, and optimizer configuration. Designed for use within Embark's plugin system; requires Embark core and solc. Key differentiator: integrates with Embark's blockchain management, testing, and deployment pipelines. Note: Embark is in maintenance/low-activity mode; consider Hardhat or Foundry for new projects.

npm install embark-solidity
INSTALL
IMPORT
SIG · EMBARK-SOLIDITY
E
embark-solidity
devopsjavascriptv6.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CompileCommand
import { CompileCommand } from 'embark-solidity'
const CompileCommand = require('embark-solidity').CompileCommand
ESM-only; require() will work but is not recommended. Also available as named export.
default
import embarkSolidity from 'embark-solidity'
Default export is the plugin function used in Embark configuration.
Solc
import { Solc } from 'embark-solidity'
const Solc = require('embark-solidity').Solc
TypeScript type for the Solc class. Use `import type { Solc } from 'embark-solidity'` for type-only imports.

Shows how to compile a Solidity contract using CompileCommand with version and optimizer settings.

import { CompileCommand } from 'embark-solidity'; const compiler = new CompileCommand({ contracts: ['MyContract.sol'], solcVersion: '0.8.0', optimizer: { enabled: true, runs: 200 }, outputDir: './build/contracts' }); compiler.compile().then(result => { console.log(result.contracts['MyContract.sol']['MyContract'].abi); }).catch(err => { console.error('Compilation failed:', err); });
Debug
Known issues
deprecatedEmbark framework is in maintenance mode; no active development since v6.0.0 (April 2020). Consider migrating to Hardhat or Foundry.
fix
Use Hardhat for Solidity development or Foundry for faster compilation and testing.
affects: >=6.0.0
breakingv6.0.0 changed the API to be ESM-only; Node.js <12 will not work without transpilation.
fix
Use Node.js >=12 and ensure your project is ESM-compatible (e.g., `"type": "module"` in package.json).
affects: >=6.0.0
gotchaThe package requires `solc` as a peer dependency; not installing it leads to runtime errors.
fix
Run `npm install solc` in your project before using embark-solidity.
affects: >=5.0.0
Errors
Common errors & fixes
Error: Cannot find module 'solc'
Missing peer dependency `solc`.
fix
Install solc: `npm install solc`
TypeError: embarkSolidity is not a function
Default import was used for a named export.
fix
Use `import { CompileCommand } from 'embark-solidity'` instead of `import embarkSolidity from 'embark-solidity'`.
SyntaxError: Cannot use import statement outside a module
Project is not configured as ESM (e.g., missing `"type": "module"` in package.json) but using `import`.
fix
Add `"type": "module"` to your package.json or use CommonJS require.
Upgrade
Version history
6.0.0latest on npm
Audit
Dependencies
solcrequiredSolidity compiler binary used for compilation
@embark/coreoptionalEmbark framework core required for plugin lifecycle
Agent activity
2 hits · last 30 days
node
2
Resources
embark-solidity — npm install embark-solidity · libregistry