Socket
Socket
Sign inDemoInstall

usage

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usage - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

.travis.yml

2

lib/usage.js

@@ -5,3 +5,3 @@ var binding = require('bindings')('node_usage');

binding.process_usage(parseInt(pid), function(err, cpu, memory) {
binding.lookup(parseInt(pid), function(err, cpu, memory) {

@@ -8,0 +8,0 @@ if(err) {

{
"name": "usage",
"version": "0.1.2",
"version": "0.1.3",
"description": "simple way to lookup linux process usage",

@@ -18,2 +18,5 @@ "keywords": [

"main": "./lib/usage.js",
"scripts": {
"test": "test/index.js"
},
"engines": {

@@ -26,4 +29,4 @@ "node": ">= 0.8.x"

"devDependencies": {
"mocha": "1.8.x"
}
}

@@ -1,5 +0,25 @@

var usage = require('../');
usage.lookup(22248, function() {
var usage = require('../');
var assert = require('assert');
console.log(arguments);
suite('Usage', function() {
test('invalid pid', function(done) {
usage.lookup(1232323, function(err) {
assert.ok(err);
done();
});
});
test('valid pid', function(done) {
usage.lookup(process.pid, function(err, result) {
assert.equal(err, null);
assert.ok(result.cpu >= 0);
assert.ok(result.memory > 0);
done();
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc