dankogai / js-base64

Base64 implementation for JavaScript
BSD 3-Clause "New" or "Revised" License
4.28k stars 1.33k forks source link

2.2.0 release breaks the library #50

Closed tylerlong closed 7 years ago

tylerlong commented 7 years ago
console.log(require('js-base64'))

image

var Base64 = require('js-base64').Base64;

Base64 is undefined.

dankogai commented 7 years ago

try npm install --save js-base64 . If you are attempting to do so in the git repo, you have to go like var Base64 = require('./base64').Base64; instead.

tylerlong commented 7 years ago

It's not that simple. I am not a Node.js newbie :)

I did it in node.js and compiled it into browser with webpack. Then run it in browser.

The same code works with 2.1.9.

A real example is https://github.com/mermaidjs/mermaid-live-editor/blob/master/package.json#L15

Try yarn upgrade js-base64 --latest and you will see that the project stops working.

dankogai commented 7 years ago

It could be because of the tag. I made sure that https://github.com/dankogai/js-base64/commit/471f1c8e938d7c34d77d9fddf5fc9ac115d21e98 is tagged 2.2.0 and https://github.com/dankogai/js-base64/commit/9192c510f5ed604d9e9dcdbb6760eba5a9eb2851 is tagged 2.1.9.

tylerlong commented 7 years ago

I installed the package via npm instead of bower, I don't think GitHub tag matters.

tylerlong commented 7 years ago

I confirm that 2.3.0 works.