open-index/open-npm huggingface dataset:
npm package: @onetapaway/serverless-jest-plugin
Description: Serverless plugin for test driven development using Jest
Author: Nordcloud
Latest version: 0.4.2

# Fork of [serverless-jest-plugin](https://github.com/nordcloud/serverless-jest-plugin)
* adds support for serverless 3.x

# Serverless Jest Plugin

[![Build Status](https://travis-ci.org/nordcloud/serverless-jest-plugin.svg?branch=master)](https://travis-ci.org/nordcloud/serverless-jest-plugin)

A Serverless Plugin for the [Serverless Framework](http://www.serverless.com) which
adds support for test-driven development using [jest](https://facebook.github.io/jest/)

**THIS PLUGIN REQUIRES SERVERLESS V1.0 OR LATER!**

More familiar with Mocha? Try [serverless-mocha-plugin](https://github.com/nordcloud/serverless-mocha-plugin).

## Introduction

This plugins does the following:

* It provides commands to create and run tests manually
* It provides a command to create a function, which automatically also creates a test

## Installation

In your service root, run:

```bash
npm install --save-dev serverless-jest-plugin
```

Add the plugin to `serverless.yml`:

```yml
plugins:
  - serverless-jest-plugin
custom:
  jest:
    # You can pass jest options here
    # See details here: https://facebook.github.io/jest/docs/configuration.html
    # For instance, uncomment next line to enable code coverage
    # collectCoverage: true
```

## Usage

### Creating functions

Functions (and associated tests) can be created using the command

```
sls create function -f functionName --handler handler
```
 
e.g.

```
sls create function -f myFunction --handler functions/myFunction/index.handler
```

creates a new function `myFunction` into `serverless.yml` with a code template for
the handler in `functions/myFunction/index.js` and a Javascript function `module.exports.handler` 
as the entrypoint for the Lambda function. A test template is also created into `test/myFunction.js`. Optionally tests can be created to specific folder using `--path` or `-p` switch, e.g. 

```
sls create function -f myFunction --handler functions/myFunction/index.handler --path tests
```

To create tests next to handler use `--path {function}`, in following example test file `myFunction.test.js` is created to `functions/myFunction/` directory.

```
sls create function -f myFunction --handler functions/myFunction/index.handler --path {function}
```

### Creating tests

Tests can also be added to existing handlers using

```
sls create test -f functionName
```

### Running tests

Tests can be run directly using Jest or using the "invoke test" command

```
sls invoke test [--stage stage] [--region region] [-f function]
```

If no function names are passed to "invoke test", all tests related to handler functions are run.

## License
https://github.com/nordcloud/serverless-jest-plugin/blob/master/LICENSE
npm package: @oneteam/clamav
Description: a network only clamd client
Author: OneTeam Services
Latest version: 1.0.1

# @oneteam/clamav

This is a nodejs network only client for clamav daemon using the [INSTREAM](https://manpages.debian.org/unstable/clamav-daemon/clamd.8.en.html#INSTREAM) command.

We have been using `clamscan` with much success until file sizes started to get above 600MB at which point `clamscan` starts to timeout. This module goes back to basic and only supports network operation (clamd doesn't need to be installed locally, it needs to be available on the network though).

To scan a file:

```js
const { scanFile } = require("@oneteam/clamav");
//clamd must be available at 127.0.0.1/3310
const result = await scanFile("myFilePath");
// result.path: "myFilePath"
// result.status: "FOUND"
// result.virus: "Virus Name"
//or
// result.status: "OK" => all good
//or
// result.status: "ERROR" => something went wrong
```

To scan a stream (eg before saving a file):

```js
const { ClamdNetworkSocket } = require("@oneteam/clamav");
const address = "127.0.0.1"; // your clamd server address
const port = "3310"; // your clamd port number
const cd = new ClamdNetworkSocket(address, port);
const myStream = ...;
const result = await cd.instream("stream name", myStream);
// result.path: "stream name"
// result.status: "FOUND"
// result.virus: "Virus Name"
//or
// result.status: "OK" => all good
//or
// result.status: "ERROR" => something went wrong
```

# clamavCLI

- `node clamavCLI.js` print the help
- `node clamavCLI.js samples` run the scan on samples in parallel
- `node clamavCLI.js eicar` create and run the scan on eicar file
- `node clamavCLI.js path/to/my/file` this will scan `path/to/my/file`

# Developers

To get started, make sure docker is installed.

This is setup to work on unix like systems, but mostly to get started, once you have generated the samples file, no need for that anymore.

- `./makeSamples.sh` to generate the samples
- `npm run clamav` this will start the docker daemon with clamav using the provided config on first run the virus database will get downloaded
- `npm run clamdtop` once the docker daemon is started, this will provide a view on the clamav instance best viewed on `80x24` console

- `npm test` run tests
- `npm run test:watch` run tests continuously
- `npm run test:log` run tests with continuously debug logs
- `npm run test:samples` run a scan on the samples in parallel