{"id":15365544,"url":"https://github.com/tunnckocore/get-comments","last_synced_at":"2025-04-15T07:31:14.891Z","repository":{"id":32697982,"uuid":"36287340","full_name":"tunnckoCore/get-comments","owner":"tunnckoCore","description":":leaves: Extract comments using @LimonJS. Comment object compatible with `acorn-extract-comments` and Esprima format. See also","archived":false,"fork":false,"pushed_at":"2015-05-30T01:13:22.000Z","size":204,"stargazers_count":12,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T12:43:31.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/limonjs/limon","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T09:58:39.000Z","updated_at":"2022-03-20T07:47:03.000Z","dependencies_parsed_at":"2022-08-25T02:20:50.918Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/get-comments","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fget-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fget-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fget-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fget-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/get-comments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249026756,"owners_count":21200502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:15:01.567Z","updated_at":"2025-04-15T07:31:14.600Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-comments [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url] \n\n\u003e Extract javascript comments on per character basis. Comment object compatible with `acorn-extract-comments` and Esprima format.\n\n**Notice:** It extracts only first level block comments, not include nested comments.\n\n[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]\n\n\n## Install\n```\nnpm i get-comments --save\nnpm test\n```\n\n\n## Usage\n\u003e For more use-cases see the [tests](./test.js)\n\n- `\u003cinput\u003e` **{String}** string to extract from\n- `[resType]` **{Boolean}** if true, will return array, otherwise object\n- `return` **{Array|Object}**\n\n**Example**\n```js\nvar getComments = require('get-comments');\n\nvar input = fs.readFileSync('./fixture.js', 'utf8')\nvar comments = getComments(input, true)\n//=\u003e\n// [ {\n//   \"start\": 249,\n//   \"end\": 1353,\n//   \"type\": \"Block\",\n//   \"loc\": {\n//     \"start\": {\n//       \"line\": 12,\n//       \"column\": 0\n//     },\n//     \"end\": {\n//       \"line\": 48,\n//       \"column\": 3\n//     }\n//   },\n//   \"value\": \"*\\n * \u003e Filtering incoming request ...\",\n//   \"api\": true,\n//   \"after\": \"module.exports = function koaIpFilter (options) {\"\n// }, {\n//   \"start\": 2187,\n//   \"end\": 2267,\n//   \"type\": \"Block\",\n//   \"loc\": {\n//     \"start\": {\n//       \"line\": 82,\n//       \"column\": 0\n//     },\n//     \"end\": {\n//       \"line\": 87,\n//       \"column\": 3\n//     }\n//   },\n//   \"value\": \"*\\n * abcd description\\n *\\n * @name koaIpFilter\\n * @param {Object} `options`\\n \",\n//   \"api\": false,\n//   \"after\": \"exports.data = function () {\"\n// } ]\n```\n\n\n## See also\n- [acorn-extract-comments](https://github.com/tunnckocore/acorn-extract-comments): Extract JavaScript code comments from a string, using `acorn`… [more](https://github.com/tunnckocore/acorn-extract-comments)\n- [acorn-strip-comments](https://github.com/tunnckocore/acorn-strip-comments): Strip code comments from given input string, using acorn javascript… [more](https://github.com/tunnckocore/acorn-strip-comments)\n- [esprima-extract-comments](https://github.com/jonschlinkert/esprima-extract-comments): Extract code comments from string or from a glob of… [more](https://github.com/jonschlinkert/esprima-extract-comments)\n- [js-comments](https://github.com/jonschlinkert/js-comments): Parse JavaScript code comments and generate API documentation.\n- [parse-comments](https://github.com/jonschlinkert/parse-comments): Parse code comments from JavaScript or any language that uses… [more](https://github.com/jonschlinkert/parse-comments)\n\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/get-comments/issues/new).  \nBut before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.\n\n\n## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]\n\n[![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]\n\n\n[npmjs-url]: https://www.npmjs.com/package/get-comments\n[npmjs-img]: https://img.shields.io/npm/v/get-comments.svg?label=get-comments\n\n[license-url]: https://github.com/tunnckoCore/get-comments/blob/master/LICENSE.md\n[license-img]: https://img.shields.io/badge/license-MIT-blue.svg\n\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/get-comments\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/get-comments.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/get-comments\n[travis-img]: https://img.shields.io/travis/tunnckoCore/get-comments.svg\n\n[coveralls-url]: https://coveralls.io/r/tunnckoCore/get-comments\n[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/get-comments.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/get-comments\n[david-img]: https://img.shields.io/david/dev/tunnckoCore/get-comments.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n\n[author-www-url]: http://www.tunnckocore.tk\n[author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg\n\n[keybase-url]: https://keybase.io/tunnckocore\n[keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg\n\n[author-npm-url]: https://www.npmjs.com/~tunnckocore\n[author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg\n\n[author-twitter-url]: https://twitter.com/tunnckoCore\n[author-twitter-img]: https://img.shields.io/badge/twitter-@tunnckoCore-55acee.svg\n\n[author-github-url]: https://github.com/tunnckoCore\n[author-github-img]: https://img.shields.io/badge/github-@tunnckoCore-4183c4.svg\n\n[freenode-url]: http://webchat.freenode.net/?channels=charlike\n[freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg\n\n[new-message-url]: https://github.com/tunnckoCore/messages\n[new-message-img]: https://img.shields.io/badge/send%20me-message-green.svg","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fget-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fget-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fget-comments/lists"}