New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

leasot

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leasot

Parse and output TODOs and FIXMEs from comments in your files

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-28.05%
Maintainers
1
Weekly downloads
 
Created
Source

leasot

Parse and output TODOs and FIXMEs from comments in your files

NPM Version NPM Downloads Build Status

Easily extract, collect and report TODOs and FIXMEs in your code. This project uses regex in order to extract your todos from comments.

Comment format

TODO: add some info

  • Spaces are optional
  • Colon is optional
  • Must be in a comment (line or block) in its' own line (some code(); //TOOD: do something is not supported)
  • Spaces are trimmed from comment text
  • Supported types are TODO and FIXME - case insensitive

Supported languages:

FiletypeExtensionNotes
Coffeescript.coffeeusing regex. Supports # comments.
Handlebars.hbsusing regex. Supports {{! }} and {{!-- --}}
Jade.jadeusing regex.
Javascript.jsusing regex. Supports // and /* */ comments
Sass.sass .scssusing regex. Supports // and /* */ comments.
Stylus.stylusing regex. Supports // and /* */ comments.
Typescript.tsusing regex. Supports // and /* */ comments.

Javascript is the default parser.

PRs for additional filetypes is most welcomed!!

Usage

Command Line

Installation
$ npm install --global leasot
Examples
❯ leasot --help

  Usage: leasot [options] [file]

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -t, --filetype [filetype]  Force filetype to parse. Useful for handling files in streams [.js]
    -r, --reporter [reporter]  Which reporter to use (table|json|xml|markdown|raw) [table]

  Examples:

    $ leasot index.js
    $ leasot --reporter json index.js
    $ cat index.js | leasot
    $ cat index.coffee | leasot --filetype .coffee

Programmatic

Installation
$ npm install --save-dev leasot
Examples
var fs = require('fs');
var leasot = require('leasot');

var contents = fs.readFileSync('./contents.js', 'utf8');
// get the filetype of the file, or force a special parser
var filetype = path.extname('./contents.js');
// add file for better reporting
var file = 'contents.js';
var todos = leasot.parse(filetype, contents, file);

// -> todos now contains the array of todos/fixme parsed

var output = leasot.reporter(todos, {
    reporter: 'json',
    spacing: 2
});

console.log(output);
// -> json output of the todos

Build Time

Built-in Reporters

  • json
  • xml
  • raw
  • table
  • markdown

Each reporter might contain config params that are useful only for that reporter:

JSON

Return a JSON valid representation of the todos.

Options
spacing

Type: Number

Default: 2

API

License

MIT ©Gilad Peleg

Keywords

FAQs

Package last updated on 30 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc