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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gibme/snmp

v22.0.0

Published

A simple SNMP helper/wrapper

Readme

@gibme/snmp

A simple async/await SNMP helper/wrapper built on top of snmp-native.

Requirements

  • Node.js >= 22

Installation

npm install @gibme/snmp
yarn add @gibme/snmp

Usage

The package supports both static methods (shared session) and instance methods (dedicated session).

Static Methods

Use static methods for simple operations that share a single underlying SNMP session:

import SNMP from '@gibme/snmp';

const options: SNMP.Options = {
    host: '192.168.1.1',
    community: 'public'
};

// Get a single OID
const result = await SNMP.get(options, '.1.3.6.1.2.1.1.1.0');

// Get multiple OIDs
const results = await SNMP.getAll(options, [
    '.1.3.6.1.2.1.1.1.0',
    '.1.3.6.1.2.1.1.5.0'
]);

// Get next OID in the tree
const next = await SNMP.getNext(options, '.1.3.6.1.2.1.1');

// Walk a subtree
const subtree = await SNMP.getSubtree(options, ['.1.3.6.1.2.1.1']);

// Set a value
await SNMP.set(options, '.1.3.6.1.2.1.1.5.0', SNMP.DataType.OctetString, 'new-hostname');

// Close the shared session when done
SNMP.close();

Instance Methods

Create instances when you need independent SNMP sessions:

import SNMP from '@gibme/snmp';

const snmp = new SNMP();

const result = await snmp.get({
    host: '192.168.1.1',
    community: 'public'
}, '.1.3.6.1.2.1.1.1.0');

// Close the instance session when done
snmp.close();

API

Methods

All methods are available as both static and instance methods.

| Method | Description | |---|---| | get(options, oid) | Perform a GetRequest for a single OID | | getAll(options, oids) | Perform GetRequests for multiple OIDs | | getNext(options, oid) | Perform a GetNextRequest | | getSubtree(options, oids) | Walk a subtree via repeated GetNextRequests | | set(options, oid, type?, value?) | Perform a SetRequest | | close() | Close the underlying SNMP session |

Types

SNMP.Options

Connection options passed to the underlying snmp-native session. Common fields:

| Field | Type | Description | |---|---|---| | host | string | SNMP agent hostname or IP address | | community | string | SNMP community string | | port | number | UDP port (default: 161) | | version | SNMP.Versions | Protocol version (default: SNMPv2c) |

SNMP.OID

A string type that must start with a dot (e.g., .1.3.6.1.2.1.1.1.0).

SNMP.Response<Type>

A Record<OID, Type | undefined> mapping each OID to its result.

SNMP.VarBind

An SNMP variable binding containing the OID and its value.

SNMP.DataType

ASN.1 data type constants: Integer, OctetString, Null, ObjectIdentifier, IPAddress, Counter, Gauge, TimeTicks, Opaque, NsapAddress, Counter64, and others.

SNMP.Versions

Protocol version constants: SNMPv1 and SNMPv2c.

Documentation

Full API documentation is available at https://gibme-npm.github.io/snmp/

License

MIT