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

ms-task

v1.1.0

Published

A Node .js wrapper for Microsoft Windows' tasklist and taskkill

Downloads

159

Readme

MS-Task

Description

MS-Task is a Node.js wrapper for Microsoft Windows' tasklist and taskkill. Tasklist "displays a list of applications and services with their Process ID (PID) for all tasks running on either a local or a remote computer." Taskkill "ends one or more tasks or processes." Supported versions: Windows XP, Vista, 7, and 8.

Installation

You may install MS-Task via NPM as follows:

npm install ms-task 

The source code is available on GitHub.

Commands

task( argumentString, callback( err, processString ))

Call tasklist.exe with the supplied argumentString. A valid argumentString is documented here and in the test. Be sure to use nested or escaped quotes when necessary in the argumentString. The callback contains err and processString variables. err is null if no erros were encountered when calling tasklist.exe with the supplied argumentString. processString is a table, list, or CSV string of information about a matched process or processes, depending on the supplied argumentString. Choosing CSV and using node-csv is an easy way to deal with the resulting data.

task.list( argumentString, callback( err, processString ))

This convenience method is equivalent to task().

task.procStat( pidOrProcessName, callback( err, processes ))

Search for a given pidOrProcessName. Both string and numeric PIDs are supported. err is null if one or more processes were found. processes is an object which contains information (process name, PID, session name, session number, and memory usage) about a matched process or processes. It has two properties, array (an array of arrays) and object (an array of objects). The properties of processes.object are name, pid, sessionName, sessionNumber, and memUsage. For example, to find the memory usage of the first process found, you could use processes.array[0][4] or processes.object[0].memUsage.

task.pidOf( processName, callback( err, processes ))

Search for one or more PIDs that match a given processName. err is null if one or more PIDs were found. processes is an array of matched PIDs.

task.nameOf( pid, callback( err, processName ))

Search for the processName that corresponds with the supplied integer or string pid.Err is null if a process name was found.

task.kill( proc, callback( err))

Kill a given process name or PID (proc). The callback is optional, and err is null if no erros were encountered when calling taskkill.exe with the supplied proc. If a process name is passed for proc, and multiple matches are found, all of the matches are killed.

Test

npm test

Improving MS-Task

If you would like to contribute code, feel free to submit a pull request. Please report issues here.