nolanlawson / blob-util

Cross-browser utils for working with binary Blobs
https://nolanlawson.github.io/blob-util
Apache License 2.0
503 stars 45 forks source link

undefined #57

Closed Aleksey-Danchin closed 5 years ago

Aleksey-Danchin commented 5 years ago

Hi. In nodejs project add blob-util through :~$ npm install blob-util --save. ES6 module work, import finds module, it's ok. But blobUtil is undefined.

import blobUtil from 'blob-util'
console.log(blobUtil) // undefined
nolanlawson commented 5 years ago

How are you using ES6 imports? Babel, esm, Webpack, --experimental-modules, something else? Node doesn't natively support ES6 modules. Also blob-util does not support Node, only the browser. :)

nolanlawson commented 5 years ago

You might also try import * as blobUtil from 'blob-util'.

nolanlawson commented 5 years ago

I updated the installation instructions after playing around with TypeScript and esm. https://github.com/nolanlawson/blob-util#install I'm pretty sure you want to use import * as blobUtil, please reopen if I'm wrong.