{"name":"sloc","version":"0.0.2","main":"./lib/sloc","bin":{"sloc":"./bin/sloc"},"description":"sloc is a simple tool to count SLOC (source lines of code)","author":{"name":"Markus Kohlhase"},"bugs":"http://github.com/flosse/sloc/issues","contributors":[{"name":"Markus Kohlhase"}],"licenses":[{"type":"GPLv3"}],"engine":"node","dependencies":{"commander":">=1.0.0","async":">=0.1.22"},"devDependencies":{"buster":">=0.6","buster-coffee":">=0.1.3","coffee-script":">=1.3.3"},"repositories":[{"type":"git","path":"git://github.com/flosse/sloc.git"}],"maintainers":[{"name":"flosse","email":"mail@markus-kohlhase.de"}],"scripts":{"test":"buster test --node"},"_id":"sloc@0.0.2","dist":{"shasum":"daca4099f7ce1b137f469477f68cc47426df77f8","tarball":"http://registry-npm.ywwl.com/sloc/download/sloc-0.0.2.tgz","integrity":"sha512-Ja3lzUpKaXKCRsLPBqU5XN8k9dng76eZnzQkzDV3DeB+rDt0m9hYfLYfpP7Bb/DvEPRLTH/wtFUhgBvkGsVDSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0XBxh0mkehwS1FPm75YOd/qRGbjKePurJ3W9WBhsYegIgDaCap/klZhBVlC8asqWk+DQghXuiZPwNQG+Ajb/P9K8="}],"size":2967,"noattachment":false,"key":"/sloc/-/sloc-0.0.2.tgz"},"directories":{},"readme":"# sloc\n\nCreate stats of your source code:\n\n- physical lines\n- lines of code (source)\n- lines with comments\n- lines with single-line comments\n- lines with block comments\n- lines mixed up with source and comments\n- empty lines within block comments\n- empty lines\n- lines with TODO's\n\n[![NPM version](https://badge.fury.io/js/sloc.svg)](http://badge.fury.io/js/sloc)\n[![License](https://img.shields.io/npm/l/sloc.svg)](https://github.com/flosse/sloc/blob/master/LICENCE.txt)\n[![Minified size](http://img.shields.io/badge/size-6,1K-blue.svg)](https://github.com/flosse/sloc)\n\n## Supported outputs\n\nIn addition to the default terminal output (see examples below), sloc provides an alternative set of output formatters:\n\n- CSV\n- JSON\n- Command line table\n\n## Install\n\nTo use sloc as an application install it globally:\n\n```shell\nsudo npm install -g sloc\n```\n\nIf you're going to use it as a Node.js module within your project:\n\n```shell\nnpm install --save sloc\n```\n\n### Browser\n\nYou can also use sloc within your browser application.\n\nLink `sloc.js` in your HTML file:\n\n```html\n<script src=\"lib/sloc.js\"></script>\n```\n\n## Usage\n\n### CLI\n\n```shell\nsloc [option] <file>|<directory>\n```\n\nOptions:\n\n```shell\n-h, --help                  output usage information\n-V, --version               output the version number\n-e, --exclude <regex>       regular expression to exclude files and folders\n-i, --include <regex>       regular expression to include files and folders\n-f, --format <format>       format output: json, csv, cli-table\n    --format-option [value] add formatter option\n-k, --keys <keys>           report only numbers of the given keys\n-d, --details               report stats of each analyzed file\n-a, --alias <custom ext>=<standard ext> alias custom ext to act like standard ext (eg. php5=php,less=css)\n```\n\ne.g.:\n\n```shell\n$ sloc src/\n\n---------- Result ------------\n\n            Physical :  1202\n              Source :  751\n             Comment :  322\n Single-line comment :  299\n       Block comment :  23\n               Mixed :  116\n               Empty :  245\n\nNumber of files read :  10\n\n------------------------------\n```\n\nor\n\n```shell\n$ sloc --details \\\n       --format cli-table \\\n       --keys total,source,comment \\\n       --exclude i18n*.\\.coffee \\\n       --format-option no-head src/\n\n┌─────────────────────────────────┬──────────┬────────┬─────────┐\n│ src/cli.coffee                  │ 98       │ 74     │ 7       │\n├─────────────────────────────────┼──────────┼────────┼─────────┤\n│ src/helpers.coffee              │ 26       │ 20     │ 0       │\n├─────────────────────────────────┼──────────┼────────┼─────────┤\n│ src/sloc.coffee                 │ 196      │ 142    │ 20      │\n├─────────────────────────────────┼──────────┼────────┼─────────┤\n│ src/formatters/simple.coffee    │ 44       │ 28     │ 7       │\n├─────────────────────────────────┼──────────┼────────┼─────────┤\n│ src/formatters/csv.coffee       │ 25       │ 14     │ 5       │\n├─────────────────────────────────┼──────────┼────────┼─────────┤\n│ src/formatters/cli-table.coffee │ 22       │ 13     │ 0       │\n└─────────────────────────────────┴──────────┴────────┴─────────┘\n```\n\n### Node.js\n\nOr use it in your own node module\n\n```javascript\nvar fs    = require('fs');\nvar sloc  = require('sloc');\n\nfs.readFile(\"mySourceFile.coffee\", \"utf8\", function(err, code){\n\n  if(err){ console.error(err); }\n  else{\n    var stats = sloc(code,\"coffee\");\n    for(i in sloc.keys){\n      var k = sloc.keys[i];\n      console.log(k + \" : \" + stats[k]);\n    }\n  }\n});\n```\n\n### Browser usage\n\n```javascript\nvar sourceCode = \"foo();\\n /* bar */\\n baz();\";\n\nvar stats = window.sloc(sourceCode,\"javascript\");\n```\n\n### Contribute an new formatter\n\n1. Fork this repo\n\n2. add the new formatter into `src/formatters/` that exports a\n   method with three arguments:\n   1. results (object)\n   2. global options (object)\n   3. formatter specific options (array)\n\n3. add the formatter in `src/cli.coffee`\n\n4. open a pull request\n\n### sloc adapters\n\n- Grunt\n  - [grunt-sloc](https://github.com/rhiokim/grunt-sloc).\n  - [grunt-sloccount](https://github.com/asciidisco/grunt-sloccount)\n  - [grunt-maxlines](https://github.com/zerok/grunt-maxlines)\n  - [grunt-file-sloc](https://github.com/bubkoo/grunt-file-sloc)\n\n- Gulp\n  - [gulp-sloc](https://github.com/oddjobsman/gulp-sloc):\n  - [gulp-sloc2](https://github.com/pnarielwala/gulp-sloc2)\n\n- [Atom](https://atom.io/)\n\n  - [atom-sloc](https://github.com/sgade/atom-sloc)\n  - [line-count](https://github.com/mark-hahn/line-count)\n\n- Jenkins\n  - [sloc-for-jenkins](https://www.npmjs.com/package/sloc-for-jenkins)\n  - [sloccount](https://github.com/asciidisco/sloccount)\n\n- Istanbul\n  - [istanbul-reporter-clover-limits](https://github.com/Cellarise/istanbul-reporter-clover-limits/)\n\n- Codemetrics\n  - [codemetrics-process-sloc](https://github.com/maxdow/codemetrics-process-sloc)\n\n## Supported languages\n\n- Assembly\n- Agda\n- Brightscript\n- C / C++\n- C#\n- Clojure / ClojureScript\n- CoffeeScript / IcedCoffeeScript\n- Crystal\n- CSS / SCSS / SASS / LESS / Stylus\n- Dart\n- Erlang\n- F#\n- Fortran\n- Go\n- Groovy\n- Handlebars\n- Haskell\n- Haxe\n- Hilbert\n- HTML\n- hy\n- Jade\n- Java\n- JavaScript\n- JSX\n- Julia\n- Kotlin\n- LaTeX\n- LilyPond\n- LiveScript\n- Lua\n- MJS\n- Mochi\n- Monkey\n- Mustache\n- Nim\n- Nix\n- Objective-C / Objective-C++\n- OCaml\n- Perl 5\n- PHP\n- PRQL\n- Pug\n- Python\n- R\n- Racket\n- Ren'Py\n- Ruby\n- Rust\n- Scala\n- Squirrel\n- SVG\n- Swift\n- Typescript\n- Visual Basic\n- XML\n- Yaml\n\n## Run tests\n\n```shell\nnpm test\n```\n\n## Build\n\n```shell\nnpm run prepublish\n```\n\n## Changelog\n\nsee `CHANGELOG.md`\n\n## License\n\nsloc is licensed under the MIT license\n","publish_time":1343646301202,"_cnpm_publish_time":1343646301202,"dist-tags":{"latest":"0.3.2"}}