{"library":"solidity-parser","title":"solidity-parser","type":"library","description":"PEG.js-based Solidity parser for JavaScript. Current stable version is 0.4.0, released as pre-alpha software. Provides parse() and parseFile() functions to convert Solidity source code into a structured JSON AST, with an optional 'imports' mode to extract imported file paths. Intended for tooling that needs to analyze or transform Solidity code without relying on heavy preprocessors. The AST structure is unstable and incomplete, and the parser may silently skip unsupported Solidity constructs. Not recommended for production use.","language":"javascript","status":"deprecated","last_verified":"Sat Apr 25","install":{"commands":["npm install solidity-parser"],"cli":null},"imports":["const SolidityParser = require('solidity-parser');","SolidityParser.parse(code);","SolidityParser.parseFile('./path/to/file.sol');"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/solidity-parser","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"const SolidityParser = require('solidity-parser');\n\nconst solidityCode = `\ncontract Test {\n  uint256 public value;\n}\n`;\n\nconst ast = SolidityParser.parse(solidityCode);\nconsole.log(JSON.stringify(ast, null, 2));\n\n// Extract imports from a file\nconst imports = SolidityParser.parseFile('./path/to/file.sol', 'imports');\nconsole.log(imports);","lang":"javascript","description":"Shows basic parse and parseFile usage with CommonJS require.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}