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

napi-deviceinfo-ai

v1.0.1

Published

AI-powered device information package - ask questions about your machine in natural language

Readme

NAPI Device Info AI

🤖 Ask questions about your machine in natural language!

An AI-powered Node.js package that lets you query your Windows device information using natural language. Powered by Azure OpenAI and native Windows APIs through N-API.

Features

  • 💬 Natural Language Interface: Ask questions like "What's my computer name?" or "How busy is my machine?"
  • 🚀 Native Performance: Uses N-API for fast, direct access to Windows system information
  • 🤖 AI-Powered: Integrates with Azure OpenAI to understand and respond to your queries
  • 🔧 Easy to Use: Simple API with sensible defaults
  • 📊 System Information: Get device name, process count, and memory information
  • 🗂️ Multi-Drive Support: Comprehensive storage information across all drives
  • 📝 Full TypeScript Support: Complete type definitions included

Installation

npm install napi-deviceinfo-ai

Note: This package is Windows-only and requires Node.js 16+.

Prerequisites

You'll need an Azure OpenAI API key to use this package. Get one from the Azure OpenAI Service.

Quick Start

import { askAboutDevice } from 'napi-deviceinfo-ai';

// Ask a question about your device
const response = await askAboutDevice("What is my computer name?", {
  apiKey: "your-azure-openai-api-key"
});

console.log(response);
// Output: "Your computer name is DESKTOP-ABC123."

API Reference

askAboutDevice(query, options)

Main function to ask questions about your device using AI.

Parameters:

  • query (string): Your question in natural language
  • options (object): Configuration options
    • apiKey (string, required): Your Azure OpenAI API key
    • endpoint (string, optional): Azure OpenAI endpoint (default: uses built-in endpoint)
    • modelName (string, optional): Model to use (default: "gpt-4")
    • deployment (string, optional): Deployment name (default: "gpt-4")
    • apiVersion (string, optional): API version (default: "2024-04-01-preview")
    • verbose (boolean, optional): Enable detailed logging (default: false)

Returns: Promise - AI response about your device

Native Functions

You can also access the underlying system information directly:

import { getDeviceName, getProcessCount, getTotalPhysicalMemory } from 'napi-deviceinfo-ai';

const deviceName = getDeviceName();           // "DESKTOP-ABC123"
const processCount = getProcessCount();       // 156
const totalMemory = getTotalPhysicalMemory(); // 17179869184 (bytes)

Example Queries

The AI can understand various types of questions:

const examples = [
  "What is my machine name?",
  "How many processes are running?",
  "How much RAM does my computer have?", 
  "Give me a summary of my device",
  "Is my computer busy right now?",
  "What's the total memory in GB?",
  "Show me my device information"
];

for (const query of examples) {
  const response = await askAboutDevice(query, { apiKey: "your-key" });
  console.log(`Q: ${query}`);
  console.log(`A: ${response}\n`);
}

TypeScript Support

Full TypeScript definitions are included with proper typing for all functions:

import { 
  askAboutDevice, 
  getCompleteDeviceInfo, 
  type CompleteDeviceInfo,
  type DeviceInfoOptions 
} from 'napi-deviceinfo-ai';

// Get complete device info with full typing
const deviceInfo: CompleteDeviceInfo = getCompleteDeviceInfo();
console.log('Device:', deviceInfo.deviceName);
console.log('Memory GB:', deviceInfo.totalMemoryBytes / (1024**3));
console.log('Drives:', deviceInfo.availableDrives);

// AI query with typed options
const options: DeviceInfoOptions = {
  apiKey: "your-api-key",
  verbose: true
};
const response = await askAboutDevice("What's my computer?", options);

Environment Variables

You can set your API key as an environment variable:

# Windows Command Prompt
set AZURE_OPENAI_API_KEY=your-api-key-here

# PowerShell
$env:AZURE_OPENAI_API_KEY="your-api-key-here"

# Then in your code:
const response = await askAboutDevice("What's my computer name?", {
  apiKey: process.env.AZURE_OPENAI_API_KEY
});

Error Handling

try {
  const response = await askAboutDevice("What's my device name?", {
    apiKey: "your-api-key"
  });
  console.log(response);
} catch (error) {
  if (error.message.includes("API key")) {
    console.error("Please provide a valid API key");
  } else {
    console.error("Error:", error.message);
  }
}

Building from Source

If you want to build the native components:

# Install dependencies
npm install

# Build the native addon
npm run build

# Run demo
npm run demo

System Requirements

  • OS: Windows only (win32)
  • Node.js: 16.0.0 or higher
  • Azure OpenAI: API key required

Contributing

Contributions welcome! This package uses:

  • N-API for native Windows system calls
  • Azure OpenAI for natural language processing
  • node-gyp for building native addons

License

MIT


Ask your computer anything! 🚀