solidity-comments
Version:
`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.
36 lines (23 loc) • 748 B
Markdown
# `solidity-comments`
`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
```bash
npm install solidity-comments
```
## API
```ts
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.