Biblical Praportio
Reddit Memes
I'm Not Here to Ma
Quest for Food
Sweepstakes and Ga
Like a Wide-Eyed K
Cornhole and
If you don’t give
The Killing Fields
Stupid People, Stubotator.com/v3/lara" . . .
https://librato.com/librato-agent/v1/events?eventId=a_9fe3b6f2fec4de58bf6d3bd3faefbcc2
I tried in Node.js, node -v is v8.10.0, and I tried https://www.npmjs.com/package/hawk and tried using https://www.npmjs.com/package/hawk-js but that only supported Node 6.2.0
Is there any alternative library for this or is there any way I could run it in Node?
A:
The Librato-Agent library is supported on Node.js v4+. You can either upgrade to a newer node version, or you can install the previous library by running npm install hawk/hawk-js@0.15.0. I just checked on a fresh install of my app and this worked for me.
A:
This issue is solved by installing hawk 1.5.7.
curl https://raw.githubusercontent.com/hueniverse/hawk/master/lib/node.js -o node.js
cp node.js /usr/bin/node
curl https://raw.githubusercontent.com/hueniverse/hawk/master/lib/index.js -o index.js
node -e "console.log(require('./index').HawkVersion)"
cd ~/node_modules
git clone https://github.com/hueniverse/hawk.git
cd ~/hawk
git checkout v1.5.7
cd ~/node_modules/hawk
npm install
node -e "console.log(require('./lib/index').HawkVersion)"
That will work because of newer versions of Hawk on GitHub have had issues. I found this solution after trying out a variety of alternatives including the hawk-client-lib.
A:
I figured it out!
https://github.com/hueniverse/hawk/issues/24
npm install hawk-js@0.12.3
it works perfectly
Hawk v0.12.3 works with node v6.9 and higher.
Note:
A newer version of Node may have updated libraries already available on its own.
Reference: https://librato.com/v3/lara/api/0.0.6/
Thanks.
If you want the command to be called with the help of another package, you will need to use commandLine instead:
var hawk = require('hawk-client-lib')('http://librato.com/v3/lara/api/0.0.6/');
hawk.post({username:'foo@bar.com',password:'supersec123', event:'api_event'})
If you just want to execute it from node you can just use runCommand from https://www.npmjs.com/package/hawk-client-lib and call it with:
hawk.runCommand(commandLine, {
username:'foo@bar.com',password:'supersec123', event:'api_event'});
The docs say you can provide more options but I didn't have luck with it. https://www.npmjs.com/package/hawk-client-lib#method-runCommand
I'm using hawk 1.5.3 as of this moment.