{"_id":"clamdjs","_rev":"3-076064404cd74fa44e8913afb837eae4","name":"clamdjs","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"author":{"name":"Lin Ning","email":"linningde25@gmail.com"},"bugs":{"url":"https://github.com/NingLin-P/clamdjs/issues"},"name":"clamdjs","version":"1.0.0","description":"A ClamAV client on node.js","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"mocha"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/NingLin-P/clamdjs.git"},"devDependencies":{"mocha":"^5.2.0","standard":"^11.0.1"},"homepage":"https://github.com/NingLin-P/clamdjs","keywords":["clamav","clamd","virus","antivirus","clamscan","security"],"license":"MIT","gitHead":"9ead65cbdf86b407ee2bb7e2b2c8a17fd76a4c11","_id":"clamdjs@1.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"zplinkng","email":"linningde25@gmail.com"},"dist":{"integrity":"sha512-gJH4Hniu79uhl7Q4jhPgiKFmBSnrSTguY1fMO8MC9cGNrM5snW4IPck4Fy+QqAxZyfMYb1Al4Bmpwo4AsOqJNQ==","shasum":"384fe128513bddacfcf9f81aca9c90ad0ce12e2d","tarball":"https://registry.npmjs.org/clamdjs/-/clamdjs-1.0.0.tgz","fileCount":4,"unpackedSize":15484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXg0rCRA9TVsSAnZWagAAPHQP/0HyJMnMT5u6YfDyooOe\ndMuAwBo5SvJKyUqF6jVzdsFmB87deIM+zO3z8ajWXgLP3TNz7cTsPgsdbeim\nS+/h/QHqidV1nUrkuX6rNBNKtLktDSwbH/eBOBkjo20gXpBwXlKnwRoxq+Te\nIOydPbAopRBY6l83SEiUNXSPO7UN5p7FHws4l8Zu75ufdOd0rc+PL9NywYf3\nzWydEphdA1ffC4buRLZmpk+2gTR2thbPqixbJYO3GDNjPUrzNsUYGW9p4PnQ\nhCb7QKQY2DUXtn7ATm9LYiPddwUs0vblTD3RlCGl25NrwkE4k+9tjiQRa/L8\nK8Q87+AzQKjdwFoqVKhvAC3cNynzY8yICCrWsLE4IRkor225+vjev65c9KFZ\nUienUKD+0HVIvcFX1/83Bk65mW4JPDn+WVFpKsVBlnsdCebfToOvSiKyE9y0\np9VmIwtDbcYKIs/ch6dWmfvs6z9gL9ecFIZzJuM6JLNRg4J6gmwkbdJW9x7g\nG/qtl0xY9Qdj2Taalkb2qawMDGHqCFq+PIjB4qNrNbJDxVTDbcqW0U5D7R8r\nNV3z+ya/QRUK3A09ZAb/nf5rsUCtjL8ZAuv/+gUvG6eKEWsIcpHEDo6Gg8zj\nu0K5Icv29B0lGDyVKJth8YCSeHLgJzswWwD4LrmYN4DOvYvOm7o/ZbCkbItT\nagOi\r\n=/Rjv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmyA4sS3RitPmYcFw7EgS4/JO/PhDJ8LnmtV7OqTOQggIhAPBEhhsZ7V65GyVBHpvPim0iVnYV1AxG0O9AypxIvnFX"}]},"maintainers":[{"name":"zplinkng","email":"linningde25@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clamdjs_1.0.0_1532890411505_0.3703201190845311"},"_hasShrinkwrap":false},"1.0.1":{"author":{"name":"Lin Ning","email":"linningde25@gmail.com"},"bugs":{"url":"https://github.com/NingLin-P/clamdjs/issues"},"name":"clamdjs","version":"1.0.1","description":"A ClamAV client on node.js","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"mocha"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/NingLin-P/clamdjs.git"},"devDependencies":{"mocha":"^5.2.0","standard":"^11.0.1"},"homepage":"https://github.com/NingLin-P/clamdjs","keywords":["clamav","clamd","virus","antivirus","clamscan","security"],"license":"MIT","gitHead":"f527dcedc6b473686d762e78bfd2ac9dde68d956","_id":"clamdjs@1.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"zplinkng","email":"linningde25@gmail.com"},"dist":{"integrity":"sha512-pAtUD0Cx9emsuuwtC90xwA3sfYuDD/zMJQUdzCX1JM8ChdGCBC8KoTkfXtV/Odf8Q378Xl5QWt9ZlVN5fxJERA==","shasum":"335740395680217cde1327f90ae000feabab62e6","tarball":"https://registry.npmjs.org/clamdjs/-/clamdjs-1.0.1.tgz","fileCount":4,"unpackedSize":15582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXoEqCRA9TVsSAnZWagAAFJoP/jHN0IugIi3fDMGAsZP1\n2MQXnbiq7TQx58yamNvO6h0tIFv0GuCjNe6MYa/n9J6MYLA8etUILPvKpVvj\n11jIIO3fRa9MFCjCZR2gjSYImsfsC7XWhcq4zXGULoCLzmZPaIBHALuxNhb1\n1bDDfUTxRtIeN7xzmREM2iT9QmTeMbcPch8xwgUKAjO7RWxLjYdqwLgBQECC\n57k3i5p8l8hR7VmW6G3Hl6MerrpOCTXJgFAJKVcGuT4MXXe/VBPm6nMAGmmB\n3CzkysD0tKylVHJreV7RIa/H9cKPo04arqUemMZtCB25yQdru2nHiJHfefBI\nOIYUMP/NdrEllVHCfKPR2ZD3fKGk5Mc584oM6FZnPyldkAHsfDpnAqsqdhrz\nEXMsKSoECo3UCOgAo8g/+S1hMhu0T+PadN0MJzjisy92XO0EXo8sLQUEPU0o\nkqH7jpRgQ1FSbOnrRYUNaUXmc/PerTPJrD1Ld1/76LfD2ViqQt3PJe9C6zkd\n1k0AXsNY3bUjO7562B2Zof9aozlJaveXvsxJXKbz6fE0lid/bpvsfKmmOvZG\n5goayvUQu2uTV97Z77OpbOV4i8A/IoUqpo7rnhBKzddh/YRkPjBr4JFmnI8q\n1+GYyEDzoxXc/sm5uloLF78bg54h20e+2bQL0J8xAnlyVIGIT7UXoV5CdrsJ\nNe1y\r\n=DNpp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxLTijTGr4XibbGO5Ez2oz2zdVK5rdS96hAXRQuTkH/QIhAPIE0BnXRlVDGSV4DXugnP/4QHJSQ9/tZqEaD10tiluN"}]},"maintainers":[{"name":"zplinkng","email":"linningde25@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clamdjs_1.0.1_1532920106652_0.34591442869959077"},"_hasShrinkwrap":false},"1.0.2":{"author":{"name":"Lin Ning","email":"linningde25@gmail.com"},"bugs":{"url":"https://github.com/NingLin-P/clamdjs/issues"},"name":"clamdjs","version":"1.0.2","description":"A ClamAV client on node.js","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"mocha"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/NingLin-P/clamdjs.git"},"devDependencies":{"mocha":"^5.2.0","standard":"^11.0.1"},"homepage":"https://github.com/NingLin-P/clamdjs","keywords":["clamav","clamd","virus","antivirus","clamscan","security"],"license":"MIT","gitHead":"dc94bc6e0b2634bd6e16c43a7b43eeed425e2683","_id":"clamdjs@1.0.2","_nodeVersion":"11.2.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-gVnX5ySMULvwYL2ykZQnP4UK4nIK7ftG6z015drJyOFgWpsqXt1Hcq4fMyPwM8LLsxfgfYKLiZi288xuTfmZBQ==","shasum":"42b3c36370979e0c19efd4e3fbc7e0bf0006a8da","tarball":"https://registry.npmjs.org/clamdjs/-/clamdjs-1.0.2.tgz","fileCount":4,"unpackedSize":16219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcki+jCRA9TVsSAnZWagAA6vMP/RfC4xzQfgHCVsDfqyjB\nnmCYsDIyGcYo9gtGA+0nGQbzq/rgM9KnBJlh0CF38nd3a4OlMSUtWkoSHmKB\nPArFZZPTjqfEqIwglQTL/AlGO09JHUhvDO7KC6+T8rDHDNkw2029+ws1CzxZ\nze26thle0FcQP+xWNoJVxsYRiXXvAEolGgiMQPVSVN4uiGneXFg+646ZWQrU\nde8l4o7LUjUdATgra6ztuX7wK2oHKeskq7F0XibF8EwgKVlv+ST2AXsL15v4\nsdaoJxmX57WnLu3Zybvfie2A37iEaXKYqKD2mxzYaiE0ocdTO2keLtZENs5Y\nd8LuceMrftzlSMz2t/MlNSwuHGUu5mogGFtTaXl8fyz0GA+6ch8fSD8q67Ly\nsRxfrQ2isEk2x9wu1P/tUY/qWau4YubgASplXbwID2oHLjrgJxzdpUbAQfiX\n4sZBs42IeJ8++dsCuF+jXqWWhaRiNJnOiHp5PIXo4/UpQti6etnAYGT+S5T6\npDyKQiSegMFCFttYkIwTk9AAWZgfvYo6+Oaw4qB6i41cRvr722Rotmzz3n2w\ni2Du9n4k6uqQZhZ20Gk+irUD/yIlwYYsTwmLGgUu2cumMSPL4eA38Dfjuqcw\nyBhzuupksZ5TOyfZcS+yuxHrtDkDZMpf/NtfvPUK4XrUqZ45wFQWwDHOdVa+\nPMhk\r\n=xglr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeHgQMpaH1UzgecMTniHmTHP4CnTGdzuRuOztA2/F6ugIhAOREjDipnoqiX6Fa74WPpuOb71a568Z/0TPzEq5Hvjb6"}]},"maintainers":[{"name":"zplinkng","email":"linningde25@gmail.com"}],"_npmUser":{"name":"zplinkng","email":"linningde25@163.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clamdjs_1.0.2_1553084322709_0.23211114701033897"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-29T18:53:31.504Z","1.0.0":"2018-07-29T18:53:31.578Z","modified":"2022-04-12T06:32:40.716Z","1.0.1":"2018-07-30T03:08:26.751Z","1.0.2":"2019-03-20T12:18:42.873Z"},"maintainers":[{"name":"zplinkng","email":"linningde25@gmail.com"}],"description":"A ClamAV client on node.js","homepage":"https://github.com/NingLin-P/clamdjs","keywords":["clamav","clamd","virus","antivirus","clamscan","security"],"repository":{"type":"git","url":"git+https://github.com/NingLin-P/clamdjs.git"},"author":{"name":"Lin Ning","email":"linningde25@gmail.com"},"bugs":{"url":"https://github.com/NingLin-P/clamdjs/issues"},"license":"MIT","readme":"Clamdjs\n===\nA ClamAV client on node.js\n---\n\nThe library will uses TCP socket communicate with `clamd` (ClamAV daemon) through some commands\n\nClamd protocol is explained here:\nhttp://linux.die.net/man/8/clamd\n\n----\n## Provide\n- Scan `Stream` and `Buffer`\n- Scan `local File` and `local Directory`\n- Check the daemon’s state\n- Get the version detail of the running ClamAV program\n\n----\n## Installation\n\n```sh\n$ npm install clamdjs\n```\n----\n### API\n```js\nconst clamd = require('clamdjs')\nconst scanner = clamd.createScanner(host, port)\n```\n## scanner.scanStream(stream, [timeout])\n```js\nscanner.scanStream(stream, 3000)\n       .then(function (reply) {\n           console.log(reply) \n           // print some thing like\n           // 'stream: OK', if not infected\n           // `stream: ${virus} FOUND`, if infected\n       })\n       .catch(handler)\n```\n**Returns a promise, which will resovle with the reply from the ClamAV server**\n- `stream (Object)` - read stream object \n- `timeout (Number)` - use to set the socket's timeout option, default `5000`\n\n## scanner.scanBuffer(buffer, [timeout], [chunkSize])\n```js\nscanner.scanBuffer(buffer, 3000, 1024 * 1024)\n       .then(function (reply) {\n           console.log(reply) \n           // print some thing like\n           // 'stream: OK', if not infected\n           // `stream: ${virus} FOUND`, if infected\n       })\n       .catch(handler)\n```\n**Returns a promise, which will resovle with the reply from the ClamAV server**\n- `buffer (Object)`\n- `timeout (Number)` - use to set the socket's timeout option, default `5000`\n- `chunkSize (Number)` - size of the chunk, which will send to ClamAV server, default `64 * 1024`\n\n## scanner.scanFile(path, [timeout], [chunkSize])\n```js\nscanner.scanFile(path, 3000, 1024 * 1024)\n       .then(function (reply) {\n           console.log(reply) \n           // print some thing like\n           // 'stream: OK', if not infected\n           // `stream: ${virus} FOUND`, if infected\n       })\n       .catch(handler)\n```\n**Returns a promise, which will resovle with the reply from the ClamAV server**\n- `path (String)` - file path, will be pass to path.normalize() first\n- `timeout (Number)` - use to set the socket's timeout option, default `5000`\n- `chunkSize (Number)` - size of the chunk, which will send to ClamAV server, default `64 * 1024`\n\n## scanner.scanDirectory(rootPath, [options])\n```js\nlet optins = {\n    timeout: 5000,\n    chunkSize: 64 * 1024,\n    scanningFile: 10,\n    detail: true,\n    cont: true\n}\nscanner.scanDirectory(rootPath, options)\n       .then(function (reply) {\n           console.log(reply) \n           /* print some thing like\n           {\n                ScannedFiles: 11,\n                Infected: 3,\n                EncounterError: 1,\n                Result:[...]\n           }\n           */\n       })\n       .catch(handler)\n```\n**Returns a promise, which will resovle with a object which contained the scan summary**\n\n- `rootPath (String)` - directory path, will be pass to path.normalize() first\n- `optinns (Object)`\n  - `timeout (Number)` - use to set the socket's timeout option, default `5000`\n  - `chunkSize (Number)` - size of the chunk, which will send to ClamAV server, default `64 * 1024`\n  - `scanningFile (Number)` - the number of file will scan concurrently, should not be greater than the file table limit in node.js, default `10`\n  - `detail (Boolean)` - if `true` the output object will contain the scan summary and all scaned files's scan result no matter infected or not, if `false` the output object will contain the scan summary and scan result of infected files and file that encountered error when scanning, default `true`\n  - `cont (Boolean)` - when scanning a path and an Error throw, if `true`, will move on to scan next path, if `false`, will stop scanning and return a rejected promise, default `true`\n\n## clamd.ping()\n**Returns true if clamd daemon alive**\n\n## clamd.version()\n**Returns clamav version information**\n\n## clamd.isCleanReply(reply)\n**Retuens true if the reply of a scan means OK, false if means infected**","readmeFilename":"README.md"}