Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Hi! I fixed some calls to "sys" for you! #41

Open
wants to merge 1 commit into from

2 participants

@node-migrator-bot

Hello rsms!

I am migrationBot, an open-source bot, and I'm here to help you migrate your codebase to node v0.8!

Did you know that the "sys" module throws an error if your program tries to require it in node v0.8? To help keep your code running, I automatically replaced var sys = require('sys') with var util = require('util').

If you'd like to know more about these changes in node.js, take a look at joyent/node@1582cf#L1R51 and https://github.com/joyent/node/blob/1582cfebd6719b2d2373547994b3dca5c8c569c0/ChangeLog#L51 .

As for myself, I was written by your friendly neighborhood node ninjas at Nodejitsu, and you can find them at #nodejitsu on irc.freenode.net or with http://webchat.jit.su .

Enjoy!

--migrationBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 22, 2012
  1. @blakmatrix
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 15 deletions.
  1. +15 −15 test.js
View
30 test.js
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
im = require('./imagemagick');
@@ -6,23 +6,23 @@ var path = 'sample-images/jpeg5.jpg';
var imdata = fs.readFileSync(path, 'binary');
im.identify(path, function(err, features){
- if (err) return sys.error(err.stack || err);
- sys.puts('features: '+sys.inspect(features));
+ if (err) return util.error(err.stack || err);
+ util.puts('features: '+util.inspect(features));
})
im.identify({data:imdata}, function(err, features){
- if (err) return sys.error(err.stack || err);
- sys.puts('features: '+sys.inspect(features));
+ if (err) return util.error(err.stack || err);
+ util.puts('features: '+util.inspect(features));
})
im.readMetadata(path, function(err, metadata){
- if (err) return sys.error(err.stack || err);
- sys.puts('metadata: '+sys.inspect(metadata));
+ if (err) return util.error(err.stack || err);
+ util.puts('metadata: '+util.inspect(metadata));
})
im.readMetadata({data:imdata}, function(err, metadata){
- if (err) return sys.error(err.stack || err);
- sys.puts('metadata: '+sys.inspect(metadata));
+ if (err) return util.error(err.stack || err);
+ util.puts('metadata: '+util.inspect(metadata));
})
var timeStarted = new Date;
@@ -31,11 +31,11 @@ im.resize({
dstPath: path+'.resized.jpg',
width: 256
}, function(err, stdout, stderr){
- if (err) return sys.error(err.stack || err);
- sys.puts('real time taken for convert: '+((new Date)-timeStarted)+' ms')
+ if (err) return util.error(err.stack || err);
+ util.puts('real time taken for convert: '+((new Date)-timeStarted)+' ms')
im.identify(['-format', '%b', path+'.resized.jpg'], function(err, r){
if (err) throw err;
- sys.puts('size: '+r.substr(0,r.length-2)+' Bytes');
+ util.puts('size: '+r.substr(0,r.length-2)+' Bytes');
})
})
@@ -44,8 +44,8 @@ im.resize({
srcData: imdata,
width: 256
}, function(err, stdout, stderr){
- if (err) return sys.error(err.stack || err);
- sys.puts('real time taken for convert (with buffers): '+((new Date)-timeStarted)+' ms');
+ if (err) return util.error(err.stack || err);
+ util.puts('real time taken for convert (with buffers): '+((new Date)-timeStarted)+' ms');
fs.writeFileSync(path+'.resized-io.jpg', stdout, 'binary');
- sys.puts('size: '+stdout.length+' Bytes');
+ util.puts('size: '+stdout.length+' Bytes');
})
Something went wrong with that request. Please try again.