open-index/open-npm huggingface dataset:
npm package: @jscore/envar
Description: Normalize environment variables, and just that.
Author: Bruno Scopelliti
Latest version: 1.0.0

# envar
Normalize environment variables, and just that.

## Install

```
npm i -S @brunoscopelliti/envar
```

## Usage

```js
const normalize = require("@jscore/envar");

// process.env;
// {
//   ENABLE_SSL: "true",
//   FEATURE_FLAG: "{ \"enableA\": true, \"enableB\": false }",
//   NODE_ENV: "production",
//   PORT: "3000"
// }

normalize(process.env);

{
  ENABLE_SSL: true,
  FEATURE_FLAG: {
    enableA: true,
    enableB: false
  },
  NODE_ENV: "production",
  PORT: 3000
}
```
npm package: @jscpd/badge-reporter
Description: Reporter for jscpd. Generate a badges with copy/paste level.
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/badge-reporter`

> The badge reporter for [jscpd](https://github.com/kucherenko/jscpd).

Generate badges like that:

![jscpd-badge-green](https://raw.githubusercontent.com/kucherenko/jscpd/master/assets/jscpd-badge.svg?sanitize=true)

## Getting started

### Install

```bash
npm install @jscpd/badge-reporter
```

### Usage

```bash
jscpd [...options] --reporters badge /path/to/source
```

### Options

```typescript

interface IBadgeOptions {
  color?: string, // color of badge, if threshold > current - green, if  threshold < current - red, no threshold provided - grey
  subject?: string, // label of the badge, default "Copy/Paste"
  style?: string, // "flat" of undefined, default - undefined
  icon?: string, // 'data:image/svg+xml;base64,...' icon
  iconWidth?: number, // width of the icon
  path?: string, // path to badge, default is 'jscpd-badge.svg' in output folder
}

```

[MIT](LICENSE) © Andrey Kucherenko
npm package: @jscpd/core
Description: core functionality of copy/paste detector for jscpd
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/core`

> core package for detect duplicates, depends only on eventemitter3.

## Installation

```
npm install @jscpd/core --save
```

## Usage

```typescript
import {Tokenizer} from '@jscpd/tokenizer';
import {
    Detector,
    MemoryStore,
    IOptions,
    IClone,
    IStore,
    ITokenizer
} from '@jscpd/core';

const options: IOptions = {
    minLines: 5,
    maxLines: 500,
}

const tokenizer: ITokenizer = new Tokenizer();

// here you can use any store what implement IStore interface
const store: IStore = new MemoryStore();

// list of validators, implemented IValidator interface, validate clones
const validators = [];

const detector = new Detector(tokenizer, store, validators, options);

( async () => {
    const format = 'javascript';
    const code: string = '...string with code...';
    const clones: IClone[] = await detector.detect('source_id', code, format);

    console.log(clones);
})();

```

![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko
npm package: @jscpd/finder
Description: detector of copy/paste in files
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/finder`

> core package for detect duplicates, depends only on eventemitter3.

## Installation

```
npm install @jscpd/finder --save
```

## Usage

```typescript
import {Tokenizer} from '@jscpd/tokenizer';
import {
    MemoryStore,
    IOptions,
    IClone,
    IStore,
    ITokenizer
} from '@jscpd/core';
import {EntryWithContent, getFilesToDetect, InFilesDetector} from '@jscpd/finder';

const options: IOptions = {
    minLines: 5,
    maxLines: 500,
    path: ['list of folders and files to analyse for clones']
}

const tokenizer: ITokenizer = new Tokenizer();
// here you can use any store what implement IStore interface
const store: IStore = new MemoryStore();
const statistic = new Statistic(options);

const files: EntryWithContent[] = getFilesToDetect(options);

const detector = new InFilesDetector(tokenizer, store, statistic, options);

( async () => {
  const clones: IClone[] = await detector.detect(files);
})();
```


![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko
npm package: @jscpd/leveldb-store
Description: leveldb store for jscpd
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/leveldb-store`

> store for jscpd, used for large repositories

## Installation

```
npm install @jscpd/leveldb-store --save
```

## Usage

```
import {Tokenizer} from '@jscpd/tokenizer';
import {
    Detector,
    IOptions,
    IClone,
    IStore,
    ITokenizer
} from '@jscpd/core';
import LeveldbStore from '@jscpd/leveldb-store';

const options: IOptions = {
    minLines: 5,
    maxLines: 500,
}

const tokenizer: ITokenizer = new Tokenizer();

const store: IStore = new LeveldbStore();

const detector = new Detector(tokenizer, store, [], options);

```

![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko
npm package: @jscpd/redis-store
Description: redis store for jscpd
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/leveldb-store`

**!NOT implemented yet**

> store for jscpd, used [redis](https://redis.io/) data store for hashes

## Installation

```
npm install @jscpd/redis-store --save
```

## Usage

```
import {Tokenizer} from '@jscpd/tokenizer';
import {
    Detector,
    IOptions,
    IClone,
    IStore,
    ITokenizer
} from '@jscpd/core';
import RedisdbStore from '@jscpd/redis-store';

const options: IOptions = {
    minLines: 5,
    maxLines: 500,
}

const tokenizer: ITokenizer = new Tokenizer();

const store: IStore = new RedisdbStore();

const detector = new Detector(tokenizer, store, [], options);

```

![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko
npm package: @jscpd/tokenizer
Description: tokenizer of source code for jscpd
Author: Andrey Kucherenko
Latest version: 4.0.5

# `@jscpd/tokenizer`

> tokenizer is package from @jscpd used for convert programming code to list of tokens


## Installation

```
npm install @jscpd/tokenizer --save
```

## Usage

```
import {IOptions,  ITokensMap} from '@jscpd/core';
import {Tokenizer} from '@jscpd/tokenizer';

const tokenizer = new Tokenizer();
const options: IOptions = {};

const maps: ITokensMap[] = tokenizer.generateMaps('source_id', 'let a = "11"', 'javascript', options);

```

![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko