{"name":"sloc","version":"0.2.0","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":{"url":"http://github.com/flosse/sloc/issues"},"contributors":[{"name":"Markus Kohlhase"},{"name":"feugy"},{"name":"Sören Gade"},{"name":"as3boyan"},{"name":"Mark Hahn"},{"name":"Hubert Sablonniere"},{"name":"programmerby"},{"name":"daclayton"},{"name":"Steven Vachon"},{"name":"yoshi6jp"},{"name":"Casper Hollingberry"},{"name":"Tobie Warburton"}],"license":"MIT","engine":"node","dependencies":{"async":"~2.1.4","cli-table":"^0.3.1","commander":"~2.9.0","readdirp":"^2.1.0"},"devDependencies":{"chai":"~3.5.0","coffee-script":"~1.12.3","coffeelint":"^1.16.0","coveralls":"^2.11.15","istanbul":"^0.4.5","mocha":"~3.2.0"},"repository":{"type":"git","url":"git://github.com/flosse/sloc.git"},"maintainers":[{"name":"flosse","email":"mail@markus-kohlhase.de"}],"files":["bin","lib"],"scripts":{"lint":"coffeelint src/","watch":"coffee -o lib -cw src/","prepublish":"coffee -o lib/ -c src/","test":"npm run lint && mocha --reporter spec --compilers coffee:coffee-script/register --recursive spec/*.spec.coffee"},"gitHead":"3fcf6877cc5ae04dd628372ca09a836fab28c2e9","homepage":"https://github.com/flosse/sloc#readme","_id":"sloc@0.2.0","_shasum":"b42d3da1a442a489f454c32c628e8ebf0007875c","_from":"sloc","_resolved":"file:sloc","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"flosse","email":"mail@markus-kohlhase.de"},"dist":{"shasum":"b42d3da1a442a489f454c32c628e8ebf0007875c","tarball":"http://registry-npm.ywwl.com/sloc/download/sloc-0.2.0.tgz","integrity":"sha512-vh5EeWhXZ5qeXsVIZOOU6LGvreGU4wj3GIs0mGnTnCpTRpMhHOJ21MT9ifJ2eK6dvf7L/GFQslMGd15TRmWyAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELOrWLy8fo2AiSgYyqrwuvB4PfILF5SrcaP70o75q8yAiBdmJQyvBV+A4R1bgV/tPBm83v5N1X/rfbIQuXIQC3sgw=="}],"size":11364,"noattachment":false,"key":"/sloc/-/sloc-0.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sloc-0.2.0.tgz_1485555908760_0.5280537428334355"},"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":1485555910778,"_cnpm_publish_time":1485555910778,"dist-tags":{"latest":"0.3.2"}}