# lizard-wrapper

> A Node.js wrapper for Lizard, a code complexity analyser.

Latest version **0.1.9** (published 2017-09-30) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install lizard-wrapper
pnpm add lizard-wrapper
yarn add lizard-wrapper
bun add lizard-wrapper
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2017-09-30 |
| First published | 2017-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | remin |
| Maintainers | remin |
| Keywords | metric, lizard |

## Links

- npm: https://www.npmjs.com/package/lizard-wrapper
- Repository: https://github.com/rdrgn/lizard-wrapper
- Homepage: https://github.com/rdrgn/lizard-wrapper#readme
- Issues: https://github.com/rdrgn/lizard-wrapper/issues
- npm.io page: https://npm.io/package/lizard-wrapper

## Recent versions

- 0.1.9 (latest) — 2017-09-30
- 0.1.8 — 2017-09-28
- 0.1.7 — 2017-09-28
- 0.1.6 — 2017-09-18
- 0.1.5 — 2017-09-18
- 0.1.4 — 2017-09-18
- 0.1.3 — 2017-09-18
- 0.1.2 — 2017-09-18
- 0.1.1 — 2017-09-17
- 0.1.0 — 2017-06-10

## README

# Lizard wrapper

A Node.js wrapper for [Lizard](https://github.com/terryyin/lizard), a code complexity analyser.

## Requirements

* Node.js
* Python
* [Lizard](https://github.com/terryyin/lizard)

```
pip install lizard
```

## Installation

```
npm install lizard-wrapper
```

## Usage

### Sample code

```js
const lizard = require('lizard-wrapper');

var result = lizard.analyzeFile('fizzbuzz.cpp');
var s = JSON.stringify(result);
console.log(s);
```

You can also use source code string instead of file.

```js
var result = lizard.analyzeSourceCode('foo.cpp', 'int foo(){}');
```

### Sample output

```json
{"filename":"fizzbuzz.cpp","nloc":15,"function_list":[{"cyclomatic_complexity":6,"nloc":13,"token_co
unt":89,"name":"main","long_name":"main()","start_line":3,"end_line":15,"parameters":[],"filename":"
fizzbuzz.cpp","top_nesting_level":0,"length":13,"fan_in":0,"fan_out":0,"general_fan_out":0}],"token_
count":96}
```

## Licence

MIT License

---
_Source: https://npm.io/package/lizard-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
