Integrating Lob Node API wrapper with MeteorJs - Issue with require('fs')
<p>I'm using Meteor 1.13 (Latest version) and they've added NPM support recently. So I added in the Lob.com NPM. I began to make a letter function and I get this error: </p>

<blockquote>
  <p>Uncaught TypeError: fs.readdirSync is not a function</p>
</blockquote>

<p>This is what my function looks like:</p>

<pre><code>import { Meteor } from 'meteor/meteor';
import 'lob';

Meteor.methods({

sendLetter(name) {

    Lob.letters.create({
    description: 'Garrison Snelling',
    to: {
        name: name,
        address_line1: '123 Test Street',
        address_city: 'Mountain View',
        address_state: 'CA',
        address_zip: '94041',
        address_country: 'US',
    },
    from: {
        name: 'Ami Wang',
        address_line1: '123 Test Avenue',
        address_city: 'Mountain View',
        address_state: 'CA',
        address_zip: '94041',
        address_country: 'US',
    },
    file: '&lt;html style="padding-top: 3in; margin: .5in;"&gt;HTML Letter for {{name}}&lt;/html&gt;',
    data: {
        name: 'Harry'
    },
    color: true
    }, function (err, res) {
    console.log(err, res);
    })
    .then(function (res) {
        console.log('The Lob API responded with this letter object: ', res);
    });

}


});
</code></pre>

<p>I've tried including 'fs' manually, but no luck... I've tried:</p>

<pre><code>var fs = require('fs'); // Didn't fail, but got same error
const fs = require('fs'); // Didn't fail, but got same error 
var fs = Npm.require('fs'); // Didn't fail, but got same error
var fs = npm.require('fs'); // Failed
var fs = Meteor.require('fs');
</code></pre>

<p>None of these worked! Any help on what is going on here would help.. Thanks!</p>