# @websvf/create-analysis

> A CLI to bootstrap my new projects

Latest version **2.6.1** (published 2021-01-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @websvf/create-analysis
pnpm add @websvf/create-analysis
yarn add @websvf/create-analysis
bun add @websvf/create-analysis
```

Provides the command `create-analysis`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.6.1 |
| Published | 2021-01-22 |
| First published | 2020-06-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 109.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | akshatsinghkaushik |
| Maintainers | akshatsinghkaushik |
| Keywords | cli, create-analysis |

## Links

- npm: https://www.npmjs.com/package/@websvf/create-analysis
- Repository: https://github.com/akshatsinghkaushik/WebSVF-backend
- Homepage: https://github.com/akshatsinghkaushik/WebSVF-backend#readme
- Issues: https://github.com/akshatsinghkaushik/WebSVF-backend/issues
- npm.io page: https://npm.io/package/@websvf/create-analysis

## Dependencies (15)

- [arg](https://npm.io/package/arg.md) ^4.1.3
- [esm](https://npm.io/package/esm.md) ^3.2.25
- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [execa](https://npm.io/package/execa.md) ^4.0.2
- [getos](https://npm.io/package/getos.md) ^3.2.1
- [listr](https://npm.io/package/listr.md) ^0.14.3
- [mocha](https://npm.io/package/mocha.md) ^7.2.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.3.0
- [home-path](https://npm.io/package/home-path.md) ^1.0.7
- [is-elevated](https://npm.io/package/is-elevated.md) ^3.0.0
- [pkg-install](https://npm.io/package/pkg-install.md) ^1.0.0
- [execa-output](https://npm.io/package/execa-output.md) ^2.0.0
- [command-exists](https://npm.io/package/command-exists.md) ^1.2.9
- [check-node-version](https://npm.io/package/check-node-version.md) ^4.0.3

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.6.1 (latest) — 2021-01-22
- 2.6.0 — 2021-01-22
- 2.5.8 — 2020-08-14
- 2.5.7 — 2020-08-14
- 2.5.6 — 2020-08-07
- 2.5.3 — 2020-08-07
- 2.5.1 — 2020-07-31
- 0.2.5 — 2020-07-23
- 0.2.4 — 2020-07-23
- 0.2.3 — 2020-07-23
- 0.2.2 — 2020-07-23
- 0.2.1 — 2020-07-23
- 0.2.0 — 2020-07-23
- 0.1.17 — 2020-07-21
- 0.1.16 — 2020-07-21
- … 32 more at https://npm.io/package/@websvf/create-analysis/versions

## README

# WebSVF-backend

## Description

This is a simple NodeJS CLI tool to easily install **_[WebSVF](https://github.com/SVF-tools/WebSVF)_** and run it.

<hr/>

## **System Requirements - Pre-Requesites**

- ### Ubuntu 18.04

  WebSVF-backend can only be used with Ubuntu 18.04 at the momemt. Due to updated user management in new versions of Ubuntu, the current application does not work properly right now. Support for Ubuntu 20.04 is coming soon.

- ### NodeJS >=v10.0

  To run the WebSVF-backend scripts, npm version greater than 10.0 is required.

- ### LLVM and Clang

  The LLVM and Clang compiler tools need to be installed and accessible from the terminal.

- ### WLLVM
  For compiling entire projects into a LLVM Bitcode (.bc) file for analysis.

<hr/>

## **Installation**

Install the command-line tool globally on your system using npm, by running the following command:

```
sudo npm i -g @websvf/create-analysis
```

<hr/>

## **Usage**

<hr style="width: 70%"/>

### **_(Optional) Setup Additional Project Dependencies (LLVM, Clang, Python, WLLVM)_**

Skip this step if you already have the required dependencies.

```
sudo create-analysis --setup-env
```

<hr style="width: 50%"/>

### **1. Install SVF**

```
sudo create-analysis -i
```

#### Options

##### **`-i`** or **`--install`** :

Installs SVF

<hr style="width: 70%"/>

### **2. Generate Analysis for LLVM Bitcode (.bc) file**

Generate the bitcode file for your program or project then run the following command from the same directory as the .bc file or specify the directory of the .bc file.

```
create-analysis
```

#### Options

##### **`-d bc-file-directory`** or **`--dir bc-file-directory`** (Optional):

Where `-d` or `--dir` flags indicate that the user wants to provide a path for the directory/folder containing the LLVM Bitcode (.bc) files. The `-d` flag is used cannot be left empty, it must be provided with a directory or the command will fail. If no `-d` flag is specified then the path for the directory containg the .bc files is assumed to be the current working directory from the terminal.

**How to compile a C project or program to LLVM Bitcode (.bc)**: [Detecting memory leaks](https://github.com/SVF-tools/SVF/wiki/Detecting-memory-leaks) (Step 2)

<hr style="width: 70%"/>

### **3. Generate Analysis using Custom Backend**

Generate the bitcode file for your program or project then run the following command from the same directory as the .bc file or specify the directory of the .bc file.

```
create-analysis --custom-backend path-to-backend-executable
```

#### Options

##### **`--custom-backend path-to-backend-executable`**:

If you have developed a custom backend for detecting memory leaks using the [SVF library](https://github.com/SVF-tools/SVF-npm) and the [SVF Example](https://github.com/SVF-tools/SVF-example).

You can specify the path to that executable using the --custom-backend option so that your new backend is used for generating the Bug Report instead of the default SVF backend bundled with WebSVF.

##### **`-d bc-file-directory`** or **`--dir bc-file-directory`** (Optional):

Where `-d` or `--dir` flags indicate that the user wants to provide a path for the directory/folder containing the LLVM Bitcode (.bc) files. The `-d` flag is used cannot be left empty, it must be provided with a directory or the command will fail. If no `-d` flag is specified then the path for the directory containg the .bc files is assumed to be the current working directory from the terminal.

### **4. Uninstall SVF**

```
sudo create-analysis -u
```

##### **`-u`** or **`--uninstall`** :

To uninstall SVF

<hr style="width: 50%"/>

### **_(Optional) Install SVF, LLVM and Clang_**

If you want to install SVF, LLVM and Clang together, you can do so by running the following command:

```
sudo create-analysis --install-all
```

### **_(Optional) Re-Install Latest SVF_**

If you want to re-install SVF installed by the `sudo create-analysis --install` command, you can do so by running the following command:

```
sudo create-analysis --reinstall-svf
```

### **_(Optional) Uninstall LLVM and Clang_**

If you want to reset the environment setup by the `sudo create-analysis --setup-env`, you can do so by running the following command:

```
sudo create-analysis --reset-env
```

### **_(Optional) Uninstall SVF, LLVM and Clang_**

If you want to SVF, LLVM and Clang altogether, you can do so by running the following command:

```
sudo create-analysis --uninstall-all
```

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