`solidity-comments` is an N-API library built in Rust, which exposes a single function, which takes the contents of a Solidity source file and returns its comments.
npm install solidity-commentssolidity-commentssolidity-comments is an N-API library built in Rust, which exposes a single function, which takes the contents of a Solidity source file and returns its comments.
``bash`
npm install solidity-comments
`ts
export interface AnalysisResult {
comments: Array
}
export interface Comment {
start: number
end: number
text: string
}
export function analyze(input: string): AnalysisResult;
`
This library doesn't work in a browser.
and index.d.tsThese files have to be committed because of our current Github Actions, yet, they are autogenerated.
You can run cargo clean, yarn clean, and yarn build` to recreate them.