diff --git a/lib/mixpanel-node.js b/lib/mixpanel-node.js
index <HASH>..<HASH> 100644
--- a/lib/mixpanel-node.js
+++ b/lib/mixpanel-node.js
@@ -61,7 +61,7 @@ var create_client = function(token, config) {
     metrics.send_request = function(options, callback) {
         callback = callback || function() {};
 
-        var content = (new Buffer(JSON.stringify(options.data))).toString('base64'),
+        var content = Buffer.from(JSON.stringify(options.data)).toString('base64'),
             endpoint = options.endpoint,
             method = (options.method || 'GET').toUpperCase(),
             query_params = {
fix Buffer() deprecation warning

i(node:<I>) [DEP<I>] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.