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

digitalocean-droplet-sdk

v1.0.0

Published

A NodeJS wrapper for the DigitalOcean Droplet API

Downloads

1

Readme

DigitalOcean-Droplet-SDK

Build Status Coverage Status Known Vulnerabilities

A simple interface to get metadata about a DigitalOcean Droplet.

Install

npm install digitalocean-droplet-sdk --save

Usage

DigitalOcean-Droplet-SDK was designed to provide a simple and easy to use interface to get metadata about the droplet that it is running on. You can chose to either request the entire metadata for a droplet, or specific values from the metadata.

Request all metadata

var dropletSDK = require('digitalocean-droplet-sdk');

dropletSDK.getMetadata().then(function(metadata) {
	/* do something with the result */
}).catch(function() {
	/* error :( */
})

Request IPv4 Private IP Addresses

var dropletSDK = require('digitalocean-droplet-sdk');

dropletSDK.getPrivateIP4Addresses().then(function(ipAddresses) {
	/* do something with the result */
}).catch(function() {
	/* error :( */
})

All available methods

| Function | Description | Type | | --- | --- | --- | | getMetadata() | Returns all the metadata for the droplet see the DigitalOcean guides for more | JSON | | getID() | Returns the id of the droplet | Number | | getVendorData() | Returns the vendor data about the droplet | String | | getAuthKey() | Returns the Auth Key | String | | getHostName() | Returns the hostname/name of the droplet | String | | getName() | Returns the hostname/name of the droplet | String | | getPublicKeys | List of public ssh keys that have been added to the droplet | Array<String> | | getRegion() | Returns the region of the droplet | String | | getInterfaces() | Returns both the public and private interfaces for the droplet. This is in the form of an object with two values; 'public' and 'private' which in turn contain arrays of respective interfaces (see format below) | JSON | | getPrivateInterfaces() | Returns an array of the private interfaces for the droplet (see format below) | JSON | | getPrivateIP4Addresses() | Returns an array of the private ipv4 addresses as strings | Array<String> | | getPrivateIP6Addresses() | Returns an array of the private ipv6 addresses as strings | Array<String> | | getPrivateMacAddresses() | Returns an array of the private MAC addresses as strings | Array<String> | | getPublicInterfaces() | Returns an array of the public interfaces for the droplet (see format below) | JSON | | getPublicIP4Addresses() | Returns an array of the public ipv4 addresses as strings | Array<String> | | getPublicIP6Addresses() | Returns an array of the public ipv6 addresses as strings | Array<String> | | getPublicMacAddresses() | Returns an array of the public MAC addresses as strings | Array<String> | | hasFloatingIP() | Returns whether or not the droplet has a floating ip | Boolean | | getFloatingIP() | Returns a string representation of the droplet floating ip if it has one, if it does not it will return a string of length 0 | String | | getDNS() | Returns an array of strings of the name servers for this droplet | Array<String> | | getNameServers() | Returns an array of strings of the name servers for this droplet | Array<String> | | getTags() | Returns an array of strings of the tags for this droplet | Array<String> | If you feel there are any missing methods please create an issue for it on GitHub.

Example Of Interface JSON
{
  'ipv4':{
    'ip_address':'10.132.255.114',
    'netmask':'255.255.0.0',
    'gateway':'10.132.0.1',
  },
  'ipv6':{
    'ip_address':'2604:A880:0800:0010:0000:0000:017D:2001',
    'cidr':64,
    'gateway':'2604:A880:0800:0010:0000:0000:0000:0001',
  },
  'mac':'04:01:2a:0f:2a:02',
  'type':'private',
}