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

@lxfater/node-wmi

v0.0.5

Published

Library to execute wmi (Windows Management Instrumentation) commands.

Downloads

3

Readme

node-wmi

Library to execute wmi (Windows Management Instrumentation) commands.

Install

npm install node-wmi

Documentation

Methods

Query([options, callback])

Constructor that generates an instance of the Query class.

Arguments

  • options - Object representing options for the query. Options can also be applied via chain api. (optional)
  • callback(err, result) - Callback. If not supplied query will not be executed until query.exec() method has been called. (optional)

Return Value The Query method returns an instance of the query class.

Options Properties

  • host (type: string) - Hostname or IP of the client to get information from. Defaults to localhost.
  • namespace (type: string) - Namespace of the class to query. Defaults to root\CIMV2.
  • class (type:string) - Class to be queried for information. (required)
  • properties/props (type: [string])- List of properties of the class to query for. If not set, all properties will be returned for the given class. (optional)
  • username (type: string) - Username to use to perform query. (optional)
  • password (type: string) - Password for the above username. (optional)
  • where (types: string, [string]) - Where clause for the query. The where clause can come in multiple different types. If you pass in a string, it will be accepted as a literal text to go in the where clause. If you pass in an array of strings, they will be And'ed together. (optional)

Chainable API Chainable api methods exists to set each property for the query. To use the chainable api, call the method of the name of the property which you would like to set with the first argument being the value of the property and an optional second argument being a callback function to execute the query.

Callback The callback has the signature of (err, result). The callback can be supplied as the second argument to either the constructor or any of the chainable functions. The callback is the first and only parameter for the exec method.

Examples

// Object usage

var wmi = require('node-wmi');
wmi.Query({
  class: 'Win32_BIOS'
}, function(err, bios) {
  console.log(bios);
});
// Chainable API reference with exec method

var wmi = require('node-wmi');
wmi.Query().class('Win32_BIOS').exec(function(err, bios) {
  console.log(bios);
});
// Using callback in chainable api

var wmi = require('node-wmi');
wmi.Query().class('Win32_LogicalDisk', function(err, disks) {
  console.log(disks);
});