Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prettier-solidity/solidity-comments-extractor
Extract comments from Solidity code
https://github.com/prettier-solidity/solidity-comments-extractor
ethereum prettier prettier-plugin solidity
Last synced: 8 days ago
JSON representation
Extract comments from Solidity code
- Host: GitHub
- URL: https://github.com/prettier-solidity/solidity-comments-extractor
- Owner: prettier-solidity
- Created: 2020-11-15T20:56:15.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T16:24:41.000Z (11 months ago)
- Last Synced: 2024-05-18T17:04:21.910Z (6 months ago)
- Topics: ethereum, prettier, prettier-plugin, solidity
- Language: JavaScript
- Homepage:
- Size: 337 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# solidity-comments-extractor
Extract comments from Solidity code
## How to
```js
const expect = require('expect');
const extractComments = require('./index');const code = `
// this is a contract
contract Foo {
}
`;const comments = extractComments(code);
expect(comments).toEqual([
{
range: [1, 22],
raw: ' this is a contract',
type: 'LineComment',
value: ' this is a contract'
}
]);
```