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.
Installation
npm install solidity-comments
API
export interface AnalysisResult {
comments: Array<Comment>;
}
export interface Comment {
start: number
end: number
text: string
}
export function analyze(input: string): AnalysisResult;
Browser support
This library doesn't work in a browser.
Regenerating index.js
and index.d.ts
These 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.