solidity-comments-extractor
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

solidity-comments-extractor

Extract comments from Solidity code

How to

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'
  }
]);

Readme

Keywords

none

Package Sidebar

Install

npm i solidity-comments-extractor

Weekly Downloads

59,544

Version

0.0.8

License

MIT

Unpacked Size

9.93 kB

Total Files

10

Last publish

Collaborators

  • mattiaerre
  • fvictorio