npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

atd

v0.2.0

Published

Javascript library for interacting with McAfee ATD appliances.

Downloads

12

Readme

atd

Node/Javascript library for interacting with McAfee ATD appliances.

Usage

Refer to the McAfee ATD API Guide and inside the library code.

Currently, the following API calls have been implemented:

  1. Connect (login)
  2. Upload (submit)
  3. GetReport (showreport)
  4. Close (logout).

Connecting

const atd = require('atd')(host, ssl, user, password);
atd.connect( function(err) { ... } );

Note: The library will automatically try and connect if you forget to call connect.

Uploading

Submitting a file can be done with a file name off disk:

atd.upload( filepath, srcip, reanalyze, function(err, meta) { ... } );

Or via a stream:

atd.upload( filename, srcip, reanalyze, function(err, meta) { ... }, stream );

On success, meta is a structure like:

{
    success: true,
    jobId: 397,
    md5: 'FD4C32A8412EED390BD66D0152EE1650',
    sha1: 'AFB23D7DBACD53B0A0564DAF259048EB9ACE8F14',
    sha256: '01534F5786529E78A0018A7D48ED385E6F20736523AB014BA505E91DD0FA0001'
}

Get Report

Get the report for a the given JobId, TaskId or md5 hash:

atd.getReport( atd.LOOKUP.???, searchValue, atd.REPORT.???, function(err, report) { ... } );

Where the LOOKUP and REPORT options are:

atd.REPORT = {
    HTML:   '...',
    TXT:    '...',
    XML:    '...',
    ZIP:    '...',
    JSON:   '...',
    IOC:    '...',
    STIX:   '...',
    PDF:    '...',
    SAMPLE: '...'
};

atd.LOOKUP = {
    JOBID:  '...',
    TASKID: '...',
    MD5:    '...'
    // todo: any others?
};

The type of the report callback parameter will be determined by the atd.REPORT type requested.

In the case of atd.REPORT.JSON, it will already be parsed, in all other cases it will be the raw response and needs to be decoded/saved/etc according to that format.

Clean Up

atd.close( function(err) { ... } );

Testing

To test the library, first copy "test/params-default.js" to "test/params.js" and enter valid ATD host IP and credentials. Then:

npm run test

license

MIT

thanks

largely ported from https://github.com/passimens/atdlib