<commit_before>## About

VirusTotal API client for node.js.

## Installation

Either manually clone this repository into your node_modules directory, or the recommended method:

> npm install virustotal.js

## Reference

> setKey(key) - Set the VirusTotal API key.

 * key      => string containing the API key

> getFileReport(resource, callback) - Retrieve a file scan report

 * resource => md5 | sha1 | sha256 | sha256-timestamp identifier aka scan_id | CVS list made up of a combination of hashes and scan_ids
 * callback => (errror, result)

> scanFile(file, callback) - Send and scan a file

 * file     => path to the file to be uploaded
 * callback => (errror, result)

> getUrlReport(resource, [scan], callback) - Retrieve an URL scan report

 * resource => URL | sha256-timestamp identifier aka scan_id | CSV list made up of a combination of hashes and scan_ids
 * scan     => [optional] when set to "1" will automatically submit the URL for analysis if no report is found
 * callback => (errror, result)

> scanUrl(url, callback) - Submit and scan an URL

 * url      => URL to be scanned
 * callback => (errror, result)

> makeComment(fileHash | url, comment, [tags], callback) - Make comments on files | URLs

 * fileHash | url => md5 | sha1 | sha256 of the file or the URL itself
 * comment  => the actual comment
 * tags     => [optional] array containing the list of tags
 * callback => (errror, result)

You may add the hashtags as part of the comment itself. If you add tags to the 'tags' argument, they are automatically appended to the comment argument. You may omit the # prefix of the tags array. It is automatically added if it's missing.

makeComment(hash, 'foo', ['bar', 'baz'], [...]) is goint to evaluate the comment as: 'foo #bar #baz'.

## Usage mode

```javascript
var vt = require('virustotal.js');
vt.setKey('your-api-key');
vt.scanFile('/path/to/file.foo.bar', function (err, res) {
	if (err) {
		console.error(err);
	} else {
		console.log(res);
	}
});
```

## Error Handling

In case of coding errors, it thorws Error() instances. Otherwise, API errors are returned as the error argument of the passed callback.<commit_msg>Typo.<commit_after>## About

VirusTotal API client for node.js.

## Installation

Either manually clone this repository into your node_modules directory, or the recommended method:

> npm install virustotal.js

## Reference

> setKey(key) - Set the VirusTotal API key.

 * key      => string containing the API key

> getFileReport(resource, callback) - Retrieve a file scan report

 * resource => md5 | sha1 | sha256 | sha256-timestamp identifier aka scan_id | CVS list made up of a combination of hashes and scan_ids
 * callback => (errror, result)

> scanFile(file, callback) - Send and scan a file

 * file     => path to the file to be uploaded
 * callback => (errror, result)

> getUrlReport(resource, [scan], callback) - Retrieve an URL scan report

 * resource => URL | sha256-timestamp identifier aka scan_id | CSV list made up of a combination of hashes and scan_ids
 * scan     => [optional] when set to "1" will automatically submit the URL for analysis if no report is found
 * callback => (errror, result)

> scanUrl(url, callback) - Submit and scan an URL

 * url      => URL to be scanned
 * callback => (errror, result)

> makeComment(fileHash | url, comment, [tags], callback) - Make comments on files | URLs

 * fileHash | url => md5 | sha1 | sha256 of the file or the URL itself
 * comment  => the actual comment
 * tags     => [optional] array containing the list of tags
 * callback => (errror, result)

You may add the hashtags as part of the comment itself. If you add tags to the 'tags' argument, they are automatically appended to the comment argument. You may omit the # prefix of the tags array. It is automatically added if it's missing.

makeComment(hash, 'foo', ['bar', 'baz'], [...]) is going to evaluate the comment as: 'foo #bar #baz'.

## Usage mode

```javascript
var vt = require('virustotal.js');
vt.setKey('your-api-key');
vt.scanFile('/path/to/file.foo.bar', function (err, res) {
	if (err) {
		console.error(err);
	} else {
		console.log(res);
	}
});
```

## Error Handling

In case of coding errors, it thorws Error() instances. Otherwise, API errors are returned as the error argument of the passed callback.
{'fraction_non_alphanumeric': 0.10417633410672854, 'fraction_numerical': 0.00788863109048724, 'mean_word_length': 3.8329596412556053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5021333', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1219, 'n_words': 557}