{"_id":"@attachmentav/virus-scan-sdk-js","_rev":"8-922ac29e49f4c85d0f4f15d6020e8d10","name":"@attachmentav/virus-scan-sdk-js","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"@attachmentav/virus-scan-sdk-js","version":"0.1.0","license":"MIT","_id":"@attachmentav/virus-scan-sdk-js@0.1.0","maintainers":[{"name":"andreaswittig","email":"andreas@widdix.de"}],"dist":{"shasum":"57cd1e7340125053f2c83d55d0513b0e3f3c0e79","tarball":"https://registry.npmjs.org/@attachmentav/virus-scan-sdk-js/-/virus-scan-sdk-js-0.1.0.tgz","fileCount":10,"integrity":"sha512-yc/FO6WD3ek3krhmmfOyD2PxybYwmU/oeIVrgDiuN1T4ZabudGEWqiBjqKyr0EnmmNI0g58ONevqHlE7DwIAsQ==","signatures":[{"sig":"MEUCIGqK/jwwErW7/LzgBZisp5QDtExoSkz+ABNvCYu9ShwtAiEAnLVhPv9mp2y4jId3Y5DJvoyC+OiSuSa4FCgv8ZGUCX4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87069},"main":"dist/index.js","browser":{"fs":false},"gitHead":"e56468696e716c559cff6451dadc3a788579d87c","scripts":{"test":"mocha --require @babel/register --recursive","build":"babel src -d dist","prepare":"npm run build"},"_npmUser":{"name":"andreaswittig","email":"andreas@widdix.de"},"_npmVersion":"10.9.2","description":"An SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with attachmentAV powered by Sophos.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@babel/cli":"^7.0.0","superagent":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.7.1","sinon":"^21.0.0","expect.js":"^0.3.1","@babel/core":"^7.0.0","@babel/register":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/plugin-proposal-decorators":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-proposal-function-bind":"^7.0.0","@babel/plugin-proposal-function-sent":"^7.0.0","@babel/plugin-proposal-do-expressions":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-numeric-separator":"^7.0.0","@babel/plugin-proposal-optional-chaining":"^7.0.0","@babel/plugin-proposal-pipeline-operator":"^7.0.0","@babel/plugin-proposal-throw-expressions":"^7.0.0","@babel/plugin-proposal-export-default-from":"^7.0.0","@babel/plugin-proposal-export-namespace-from":"^7.0.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.0.0","@babel/plugin-proposal-logical-assignment-operators":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/virus-scan-sdk-js_0.1.0_1752658881852_0.7346372220276385","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"@attachmentav/virus-scan-sdk-js","version":"0.2.0","license":"MIT","_id":"@attachmentav/virus-scan-sdk-js@0.2.0","maintainers":[{"name":"andreaswittig","email":"andreas@widdix.de"}],"homepage":"https://github.com/widdix/attachmentav-sdk-js#readme","bugs":{"url":"https://github.com/widdix/attachmentav-sdk-js/issues"},"dist":{"shasum":"63af0c638c4288410caf076f782a0c025d52f1ec","tarball":"https://registry.npmjs.org/@attachmentav/virus-scan-sdk-js/-/virus-scan-sdk-js-0.2.0.tgz","fileCount":10,"integrity":"sha512-Y7ZB1hNXsbcasPzvf0gjVYnA8ySx+GQ018TdQi6it82nCkIZ7FB+XuilbCnf3GaqWHIMn/JR9354BFnzrYBvkA==","signatures":[{"sig":"MEQCIFAkv8EKlzk6r+1Mpl4UEqKiGHfx59/piqhfSPBAZo3sAiAMPJeHuBlmuTFK5KnEZ5S9gL2vleJ8viGOaONGhccu1Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":88019},"main":"dist/index.js","browser":{"fs":false},"gitHead":"81de7e04c17ed164206e5eba4ff73a6a360f8b84","scripts":{"test":"mocha --require @babel/register --recursive","build":"babel src -d dist","prepare":"npm run build"},"_npmUser":{"name":"andreaswittig","email":"andreas@widdix.de"},"repository":{"url":"git+https://github.com/widdix/attachmentav-sdk-js.git","type":"git"},"_npmVersion":"10.9.2","description":"An SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with attachmentAV powered by Sophos.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@babel/cli":"^7.0.0","superagent":"^10.2.2"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.7.1","sinon":"^21.0.0","expect.js":"^0.3.1","@babel/core":"^7.0.0","@babel/register":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/plugin-proposal-decorators":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-proposal-function-bind":"^7.0.0","@babel/plugin-proposal-function-sent":"^7.0.0","@babel/plugin-proposal-do-expressions":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-numeric-separator":"^7.0.0","@babel/plugin-proposal-optional-chaining":"^7.0.0","@babel/plugin-proposal-pipeline-operator":"^7.0.0","@babel/plugin-proposal-throw-expressions":"^7.0.0","@babel/plugin-proposal-export-default-from":"^7.0.0","@babel/plugin-proposal-export-namespace-from":"^7.0.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.0.0","@babel/plugin-proposal-logical-assignment-operators":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/virus-scan-sdk-js_0.2.0_1752756430450_0.8553034833571245","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.0":{"name":"@attachmentav/virus-scan-sdk-js","version":"0.3.0","license":"MIT","_id":"@attachmentav/virus-scan-sdk-js@0.3.0","maintainers":[{"name":"andreaswittig","email":"andreas@widdix.de"},{"name":"hellomichibye","email":"post@michaelwittig.info"}],"dist":{"shasum":"2f3ada3c3244288faf8383ab8afaf706532418ce","tarball":"https://registry.npmjs.org/@attachmentav/virus-scan-sdk-js/-/virus-scan-sdk-js-0.3.0.tgz","fileCount":10,"integrity":"sha512-D0GQ3EyrOXv/+5U2RzvpETJp2BtucTBqESXBEwtfFXgA9tBhObtuAB+1eqajqyXi0cDiXVSNGUA5uBfSwYVAvQ==","signatures":[{"sig":"MEUCID1Quhfkbh+esSUrSflzZZ47w1lc+18pTtxjc0WBMDfRAiEAjJ45p2sJF1ugvEOSOgWL8sqDleDWNBs92+fsWyaX/j0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87066},"main":"dist/index.js","browser":{"fs":false},"gitHead":"5bf3ffdc74736d48379500e33648871f26527582","scripts":{"test":"mocha --require @babel/register --recursive","build":"babel src -d dist","prepare":"npm run build"},"_npmUser":{"name":"hellomichibye","email":"post@michaelwittig.info"},"_npmVersion":"11.3.0","description":"An SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with attachmentAV powered by Sophos.","directories":{},"_nodeVersion":"24.0.0","dependencies":{"@babel/cli":"^7.0.0","superagent":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.7.1","sinon":"^21.0.0","expect.js":"^0.3.1","@babel/core":"^7.0.0","@babel/register":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/plugin-proposal-decorators":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-proposal-function-bind":"^7.0.0","@babel/plugin-proposal-function-sent":"^7.0.0","@babel/plugin-proposal-do-expressions":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-numeric-separator":"^7.0.0","@babel/plugin-proposal-optional-chaining":"^7.0.0","@babel/plugin-proposal-pipeline-operator":"^7.0.0","@babel/plugin-proposal-throw-expressions":"^7.0.0","@babel/plugin-proposal-export-default-from":"^7.0.0","@babel/plugin-proposal-export-namespace-from":"^7.0.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.0.0","@babel/plugin-proposal-logical-assignment-operators":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/virus-scan-sdk-js_0.3.0_1758794029336_0.5976652046424928","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.1":{"name":"@attachmentav/virus-scan-sdk-js","version":"0.3.1","license":"MIT","_id":"@attachmentav/virus-scan-sdk-js@0.3.1","maintainers":[{"name":"andreaswittig","email":"andreas@widdix.de"},{"name":"hellomichibye","email":"post@michaelwittig.info"}],"dist":{"shasum":"b795df864f4ca26423d721d28f5b0e7c64571717","tarball":"https://registry.npmjs.org/@attachmentav/virus-scan-sdk-js/-/virus-scan-sdk-js-0.3.1.tgz","fileCount":10,"integrity":"sha512-mD8e1IRSH+79B2syoC1V4ZLnTWTiD688sWsFsDYh6hCGY24nOx2lZYxLCR3tiloqXztc4CwT9iTybc92DvyG2Q==","signatures":[{"sig":"MEQCIDL6qeNP0LfecQEowyfgTTiBBk0caGJhq4iG93RXcWIFAiB/yYjd+RBKS70TXwJYsmsY8UfXeWRMY+bBDjHmz337nw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87152},"main":"dist/index.js","browser":{"fs":false},"gitHead":"525cdbc78bdf82601664a8646a5099cc3c0e1fb4","scripts":{"test":"mocha --require @babel/register --recursive","build":"babel src -d dist","prepare":"npm run build"},"_npmUser":{"name":"hellomichibye","email":"post@michaelwittig.info"},"_npmVersion":"11.3.0","description":"An SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with attachmentAV powered by Sophos.","directories":{},"_nodeVersion":"24.0.0","dependencies":{"@babel/cli":"^7.0.0","superagent":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.7.1","sinon":"^21.0.0","expect.js":"^0.3.1","@babel/core":"^7.0.0","@babel/register":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/plugin-proposal-decorators":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-proposal-function-bind":"^7.0.0","@babel/plugin-proposal-function-sent":"^7.0.0","@babel/plugin-proposal-do-expressions":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-numeric-separator":"^7.0.0","@babel/plugin-proposal-optional-chaining":"^7.0.0","@babel/plugin-proposal-pipeline-operator":"^7.0.0","@babel/plugin-proposal-throw-expressions":"^7.0.0","@babel/plugin-proposal-export-default-from":"^7.0.0","@babel/plugin-proposal-export-namespace-from":"^7.0.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.0.0","@babel/plugin-proposal-logical-assignment-operators":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/virus-scan-sdk-js_0.3.1_1758878302472_0.9653766536758983","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2025-07-16T09:36:58.595Z","modified":"2025-09-26T09:20:03.356Z","1.0.0":"2025-07-16T09:36:58.835Z","0.1.0":"2025-07-16T09:41:22.029Z","0.2.0":"2025-07-17T12:47:10.620Z","0.3.0":"2025-09-25T09:53:49.545Z","0.3.1":"2025-09-26T09:18:22.695Z"},"license":"MIT","description":"An SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with attachmentAV powered by Sophos.","maintainers":[{"name":"andreaswittig","email":"andreas@widdix.de"},{"name":"hellomichibye","email":"post@michaelwittig.info"}],"readme":"# attachmentav-sdk-js\n\n> Project is deprecated. Instead, use https://github.com/widdix/attachmentav-sdk-ts!\n\nAn SDK to integrate virus and malware scan capabilities into JavaScript applications. Scan files for viruses, trojans, and other kinds of malware with [attachmentAV](https://attachmentav.com) powered by Sophos.\n\n## Getting started\n\nFirst, install the module.\n\n```sh\nnpm i @attachmentav/virus-scan-sdk-js\n```\n\nSecond, get an API key by [subscribing to the attachmentAV API (SaaS)](https://attachmentav.com/subscribe/api/).\n\nThird, send a scan request. Make sure to replace the `API_KEY_PLACEHOLDER` placeholder.\n\n```js\nconst { ApiClient, AttachmentAVApi }  = require('@attachmentav/virus-scan-sdk-js');\nconst fs = require('fs');\n\nconst ATTACHMENTAV_API_KEY = '<API_KEY_PLACEHOLDER>';\n\nconst defaultClient = ApiClient.instance;\nconst apiKeyAuth = defaultClient.authentications['apiKeyAuth'];\napiKeyAuth.apiKey = ATTACHMENTAV_API_KEY;\n\nconst api = new AttachmentAVApi()\napi.scanSyncBinaryPost(fs.readFileSync('/path/to/file'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log(JSON.stringify(data));\n  }\n});\n```\n\nThe request returns a scan result similar to the following example.\n\n```\n{\"status\":\"clean\",\"size\":\"1024\",\"realfiletype\":\"...\"}\n```\n\n## What is attachmentAV?\n\n[attachmentAV](https://attachmentav.com) offers antivirus for SaaS and cloud platforms. Scan your files and attachments stored in the cloud for viruses, worms, and trojans. attachmentAV detects malware in real-time. Supports Amazon S3, Atlassian, Cloudflare R2, Salesforce, WordPress, and more.\n\nThe [attachmentAV Virus and Malware Scan API](https://attachmentav.com/solution/virus-malware-scan-api/) provides a REST API that allows you to integrate malware scans into your application. The solution comes in two variants:\n\n* [attachmentAV Virus Scan API (SaaS)](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/): Get started quickly with a fully managed service.\n* [attachmentAV Virus Scan API (self-hosted on AWS)](https://attachmentav.com/help/virus-malware-scan-api-aws/setup-guide/): Deploy the production-ready API on AWS.\n\nattachmentAV raises the bar for information security. Our solution is ISO 27001 certified and GDPR compliant. We are establishing, implementing, maintaining, and continually improving an information security management system (ISMS). Sensitive data is encrypted in transit as well as at rest and deleted immediately after processing. More than 1,000 customers trust our malware protection technology.\n\n## Install SDK\n\n```sh\nnpm i @attachmentav/virus-scan-sdk-js\n```\n\n## Configure SDK\n\n### Configure SDK (SaaS)\n\nAn [active subscription and API key](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/#api-key) are required. Replace `<API_KEY_PLACEHOLDER>` with the API key.\n\n```javascript\nconst { ApiClient, AttachmentAVApi }  = require('@attachmentav/virus-scan-sdk-js');\nconst fs = require('fs');\n\nconst ATTACHMENTAV_API_KEY = '<API_KEY_PLACEHOLDER>';\n\nconst defaultClient = ApiClient.instance;\nconst apiKeyAuth = defaultClient.authentications['apiKeyAuth'];\napiKeyAuth.apiKey = ATTACHMENTAV_API_KEY;\n\nconst api = new AttachmentAVApi()\n```\n\n### Configure SDK (self-hosted on AWS)\n\nWhen following the setup guide, you specified the `ApiKeys` parameter for the CloudFormation stack. Replace `<API_KEY_PLACEHOLDER>` with one of those keys. \n\n```javascript\nconst { ApiClient, AttachmentAVApi }  = require('@attachmentav/virus-scan-sdk-js');\nconst fs = require('fs');\n\nconst ATTACHMENTAV_API_KEY = '<API_KEY_PLACEHOLDER>';\n\nconst defaultClient = ApiClient.instance;\nconst bearerAuth = defaultClient.authentications['bearerAuth'];\nbearerAuth.accessToken = ATTACHMENTAV_API_KEY;\ndefaultClient.basePath = 'https://example.com/api/v1';\n\nconst api = new AttachmentAVApi()\n```\n\n## Examples\n\n\n### Sync Scan: File\n\nSend a file to the attachmentAV Virus Scan API and process the scan result.\n\nMaximum file size is 10 MB. The request timeout is 60 seconds.\n\n\n```javascript\napi.scanSyncBinaryPost(fs.readFileSync('README.md'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log(JSON.stringify(data));\n  }\n});\n```\n\n### Sync Scan: Download\n\nSend a URL to the attachmentAV Virus Scan API. attachmentAV will download the file and return the scan result immediately.\n\nMaximum file size is 10 MB. The request timeout is 60 seconds.\n\n\n```javascript\napi.scanSyncDownloadPost(new SyncDownloadScanRequest('https://example.com/download.txt'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log(JSON.stringify(data));\n  }\n});\n```\n\n### Sync Scan: S3\n\nSend an S3 bucket name and object key to the attachmentAV Virus Scan API. attachmentAV will download the file and return the scan result immediately.\n\nMaximum file size is 10 MB. The request timeout is 60 seconds.\n\n> A [bucket policy](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/#s3-bucket-policy) is required to grant attachmentAV access to private S3 objects.\n\n```javascript\napi.scanSyncS3Post(new SyncS3ScanRequest('example-bucket', 'demo.txt'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log(JSON.stringify(data));\n  }\n});\n```\n\n### Async Scan: Download\n\nSend a URL to the attachmentAV Virus Scan API. attachmentAV will send the scan result to the callback URL. See [callback URL](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/#callback-url) for details.\n\nThe maximum file size is 5 GB. The request timeout is 29 seconds; the asynchronous scan job is not affected by this limit.\n\n> Not supported by attachmentAV Virus Scan API (Self-hosted on AWS) yet. Contact [hello@attachmentav.com](hello@attachmentav.com) to let us know, in case you need this feature. \n\n```javascript\napi.scanAsyncDownloadPost(new AsyncDownloadScanRequest('https://example.com/download.txt', 'https://example.com/callback'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log('Successfully submitted scan job. Scan result will be sent to callback URL.');\n  }\n});\n```\n\n### Async Scan: S3\n\nSend an S3 bucket name and object key to the attachmentAV Virus Scan API.  attachmentAV will send the scan result to the callback URL. See [callback URL](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/#callback-url) for details.\n\nThe maximum file size is 5 GB. The request timeout is 29 seconds; the asynchronous scan job is not affected by this limit.\n\n> A [bucket policy](https://attachmentav.com/help/virus-malware-scan-api/setup-guide/#s3-bucket-policy) is required to grant attachmentAV access to private S3 objects.\n\n> Not supported by attachmentAV Virus Scan API (Self-hosted on AWS) yet. Contact [hello@attachmentav.com](hello@attachmentav.com) to let us know, in case you need this feature.\n\n```javascript\napi.scanAsyncS3Post(new AsyncS3ScanRequest('example-bucket', 'demo.txt', 'https://example.com/callback'), function(err, data, response) {\n  if (err) {\n    console.log(err);\n  } else {\n    console.log('Successfully submitted scan job. Scan result will be sent to callback URL.');\n  }\n});\n```\n\n## Need help?\n\nDo you need any help to get started with attachmentAV? [hello@attachmentav.com](mailto:hello@attachmentav.com).\n","readmeFilename":"README.md"}