{"id":13749268,"url":"https://github.com/pgilad/leasot","last_synced_at":"2025-04-11T06:18:25.735Z","repository":{"id":23861790,"uuid":"27240048","full_name":"pgilad/leasot","owner":"pgilad","description":"Parse and output TODOs and FIXMEs from comments in your files","archived":false,"fork":false,"pushed_at":"2024-06-03T09:41:11.000Z","size":1904,"stargazers_count":808,"open_issues_count":6,"forks_count":59,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-03T22:05:38.065Z","etag":null,"topics":["automation","comments","extract","fixme","hacktoberfest","javascript","parse","productivity","todo"],"latest_commit_sha":null,"homepage":"https://pgilad.github.io/leasot","language":"TypeScript","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/pgilad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pgilad"}},"created_at":"2014-11-27T20:16:14.000Z","updated_at":"2025-04-01T16:05:14.000Z","dependencies_parsed_at":"2023-02-12T14:30:35.681Z","dependency_job_id":"ee0c1a09-38c3-4e21-995b-7b12b7fad67a","html_url":"https://github.com/pgilad/leasot","commit_stats":{"total_commits":453,"total_committers":56,"mean_commits":8.089285714285714,"dds":"0.48123620309050774","last_synced_commit":"181ab1816e05038c3bc472f054058174593764e0"},"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fleasot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fleasot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fleasot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgilad%2Fleasot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgilad","download_url":"https://codeload.github.com/pgilad/leasot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351482,"owners_count":21089286,"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":["automation","comments","extract","fixme","hacktoberfest","javascript","parse","productivity","todo"],"created_at":"2024-08-03T07:00:58.201Z","updated_at":"2025-04-11T06:18:25.710Z","avatar_url":"https://github.com/pgilad.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cimg width=\"320\" src=\"media/leasot.png\" alt=\"Leasot\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n    Leasot\n\u003c/h1\u003e\n\n\u003e Intelligently parse and output TODOs and FIXMEs from comments in your files\n\n[![npm](https://img.shields.io/npm/v/leasot.svg?style=for-the-badge)](https://www.npmjs.com/package/leasot)\n[![npm downloads](https://img.shields.io/npm/dm/leasot.svg?style=for-the-badge)](https://www.npmjs.com/package/leasot)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)\n\nEasily extract, collect and report TODOs and FIXMEs in your code. This project uses regex in order\nto extract your todos from comments.\n\n![Basic output example of leasot](media/table.png)\n\n## Comment format\n\n`TODO: add some info`\n\n- Spaces are optional.\n- Colon is optional.\n- Must be in a comment (line or block) in its own line (`some code(); //TODO: do something` is not supported).\n- Can be prefixed with a @ (i.e. @TODO).\n- Spaces are trimmed around comment text.\n- Supported default types are `TODO` and `FIXME` - case-insensitive.\n- Additional types can be added (using `tags` in cli and `customTags` in `leasot.parse`)\n- New extensions can be associated with bundled parsers as many languages have overlapping syntax\n- Supports both leading and trailing references. Examples:\n    - `// TODO(tregusti): Make this better`\n    - `// TODO: Text /tregusti`\n\n## Supported languages\n\n[49+ languages are supported](./media/supported-languages.md), pull requests for additional language support is most welcomed!\n\n## Usage in command line\n\n```bash\nnpm install --global leasot\n```\n\n## Command line help\n\n```bash\n$ leasot --help\n\nUsage: leasot [options] \u003cfile ...\u003e\n\nParse and output TODOs and FIXMEs from comments in your files\n\nOptions:\n  -V, --version                        output the version number\n  -A, --associate-parser [ext,parser]  associate unknown extensions with bundled parsers (parser optional / default: defaultParser) (default: {})\n  -i, --ignore \u003cpatterns\u003e              add ignore patterns (default: [])\n  -I, --inline-files                   parse possible inline files (default: false)\n  -r, --reporter [reporter]            use reporter (table|json|xml|markdown|vscode|gitlab|raw) (default: table) (default: \"table\")\n  -S, --skip-unsupported               skip unsupported filetypes (default: false)\n  -t, --filetype [filetype]            force the filetype to parse. Useful for streams (default: .js)\n  -T, --tags \u003ctags\u003e                    add additional comment types to find (alongside todo \u0026 fixme) (default: [])\n  -x, --exit-nicely                    exit with exit code 0 even if todos/fixmes are found (default: false)\n  -h, --help                           output usage information\n\nExamples:\n    # Check a specific file\n    $ leasot index.js\n\n    # Check php files with glob\n    $ leasot '**/*.php'\n\n    # Check multiple different filetypes\n    $ leasot 'app/**/*.js' test.rb\n\n    # Use the json reporter\n    $ leasot --reporter json index.js\n\n    # Search for REVIEW comments as well\n    $ leasot --tags review index.js\n\n    # Add ignore pattern to filter matches\n    $ leasot 'app/**/*.js' --ignore '**/custom.js'\n\n    # Search for REVIEW comments as well\n    $ leasot --tags review index.js\n\n    # Check a stream specifying the filetype as coffee\n    $ cat index.coffee | leasot --filetype .coffee\n\n    # Report from leasot parsing and filter todos using `jq`\n    $ leasot 'tests/**/*.styl' --reporter json | jq 'map(select(.tag == \"TODO\"))' | leasot-reporter\n\n    # Associate a parser for an unknown extension`\n    $ leasot -A '.svelte,twigParser' -A '.svelte,defaultParser' 'frontend/*.svelte'\n```\n\n### Usage in NPM scripts\n\nUse `leasot -x` in order to prevent exiting with a non-zero exit code. This is a good solution if you plan to\nrun `leasot` in a CI tool to generate todos.\n\n```json\n{\n    \"scripts\": {\n        \"todo\": \"leasot 'src/**/*.js'\",\n        \"todo-ci\": \"leasot -x --reporter markdown 'src/**/*.js' \u003e TODO.md\"\n    },\n    \"devDependencies\": {\n        \"leasot\": \"^7.0.0\"\n    }\n}\n```\n\n### Programmatic Installation\n\n```bash\nnpm install --save-dev leasot\n```\n\n### Programmatic Examples\n\n```js\nconst fs = require('fs');\nconst leasot = require('leasot');\n\nconst contents = fs.readFileSync('./contents.js', 'utf8');\n// get the filetype of the file, or force a special parser\nconst filetype = path.extname('./contents.js');\n// add file for better reporting\nconst file = 'contents.js';\nconst todos = leasot.parse(contents, { extension: filetype, filename: file });\n\n// -\u003e todos now contains the array of todos/fixme parsed\n\nconst output = leasot.report(todos, 'json', { spacing: 2 });\n\nconsole.log(output);\n// -\u003e json output of the todos\n```\n\n### Leasot with build tools\n\n- [gulp-todo](https://github.com/pgilad/gulp-todo)\n- [broccoli-leasot](https://github.com/sivakumar-kailasam/broccoli-leasot)\n- [todo-webpack-plugin](https://github.com/mikeerickson/todo-webpack-plugin)\n\n## API\n\n```js\nconst leasot = require('leasot');\n```\n\nSee [main exported functions](src/index.ts)\n\nMainly, you should be using 2 functions:\n\n- [parse](https://pgilad.github.io/leasot/index.html#parse) for parsing file contents\n- [report](https://pgilad.github.io/leasot/index.html#report) for reporting the todos\n\n[Type documentation](https://pgilad.github.io/leasot)\n\n## Built-in Reporters\n\nSee [built-in reporters](https://pgilad.github.io/leasot/enums/builtinreporters.html)\n\n## License\n\nMIT © [Gilad Peleg](https://www.giladpeleg.com)\n","funding_links":["https://github.com/sponsors/pgilad"],"categories":["JavaScript","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgilad%2Fleasot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgilad%2Fleasot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgilad%2Fleasot/lists"}