Node Wrapper and CLI

Apr 5, 2013 by Jarrett Streebin

Good news! @niftylettuce over at Teelaunch wrote a fantastic node.js wrapper for the EasyPost API, plus a super cool command line interface. Check it out!

https://github.com/EasyPost/easypost-node

Not familiar with Node? That’s okay, it’s dead simple.

1. Download Node.js: http://nodejs.org/download/

2. Enter the following in your Terminal:

npm install -g easypostjs

You may need to ‘sudo’ this:

sudo npm install -g easypostjs

3. Sign up for an account or login to your existing account and grab your Test API key. (Best to start with test, then once you get used to everything you can use your Secret API key to buy real postage.)

4. Enter the following in your Terminal with replaced by your Test API key.

easypost <your-api-key>

5. Boom! You’re off and running with the EasyPost API.

Choose an option: 
1) Verify a single address
2) Verify multiple addresses
3) Get multiple shipment rates
4) Get shipment rates
5) Buy postage
6) Lookup individual label purchased
7) Get full list of labels purchased
:

6. Want to use this in your app? Simply require it and utilize the API endpoints:

var easypost = require('easypostjs')('your-api-key')

// Verify an address
easypost.address.verify(data, cb)
function cb(err, response) {
if (err) return console.log(err)
console.log(response)
}

Let us know if you have any feedback or questions!

Note: we’re hiring like mad and we need your help building EasyPost. Drop us a line at !