tomprogers/eztxt4fs

ES6 import not working?

Closed this issue · 2 comments

I tried this in a webpacked ES6 project, and it failed:

import Textfile from 'eztxt4fs'

const Prefs = new Textfile( filepath );

It blew up because "Textfile is not a function".

After some experimentation, I had to do this:

const Prefs = new Textfile.default( filepath )

Obv not what I had in mind. It appears something is wrong with the way I'm building lib. UGH.

I obv want this module to work in a variety of environments: ES5, ES6, etc. I thought I had solved for that by putting my code into a fork of es6-node-module-boilerplate, but I guess I was wrong.

I believe this is fixed now.