You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@nerdvision/agent

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nerdvision/agent

The official node agent for NerdVision

2.0.4
latest
Source
npmnpm
Version published
Weekly downloads
6
Maintainers
3
Weekly downloads
 
Created
Source

https://nerd.vision node agent

This is the official nerd.vision node agent. We're constantly looking to improve, so please send us feedback on it's usability and if you find any issues! You can see the known issues at the bottom of this readme.

Requirements

  • Node 10+

Documentation

You can find the documentation at docs.nerd.vision

Installation

npm i @nerdvision/agent

Configuration Properties

All configuration properties are defined in NerdVisionConfig

interface NerdVisionConfig {
	api_key: string;
	name?: string; // default: my-node-app
	debug?: boolean; // default: false
	tags?: { [key: string]: string }; // default: {}
}
⚠ Breaking change in v1.0.0: ️apiKey has been renamed to api_key

Usage

Both init and wrap accept an API key, or the configuration object. The example below is typescript, but nerd.vision works perfectly with normal javascript as well.

const {nerdvision, NerdVisionConfig} = require('@nerdvision/agent');

const config: NerdVisionConfig = {
	api_key: 'API_KEY', // you can find yours at https://account.nerd.vision/account/apikeys
};

//
// THEN
//

nerdvision.init('API_KEY').then(() => {
	// application code
});

//
// OR
//

nerdvision.init(config).then(() => {
	// application code
});

When Node exits, nerd.vision should automatically disconnect. If you want to ensure that it has disconnected, you can explicitly call close in your shutdown handler:

nerdvision.close();

You can also use .wrap to automatically disconnect after your code has run. This is more useful for applications that shut down after processing.

nerdvision.wrap(config, async () => {
	// application code
	
	// this function must return a promise
	// when it resolves, nerd.vision will disconnect automatically
});

Examples

There are two example node applications for nerd.vision.

Troubleshooting

I get the error TS7016: Could not find a declaration file for module 'google-protobuf'

  • You need to install types for google-protobuf: npm i -D @types/google-protobuf

I get errors when i use import on nerd.vision

  • Please use the require syntax above for now, we're actively looking into fixing this

Known issues

  • When using a pre-processor for JavaScript, like TypeScript, files that are lazy loaded may not trigger until they are run for a second time.
  • ts-node is not supported yet. As a work around, you can build your code with tsc and run it directly with node for tracepoints to fire

Keywords

nerdvision

FAQs

Package last updated on 15 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.